I've lunched a Bitcoin Core server, and trying to connect to it via JSON-RPC. This is my configuration settings:


But all cURL connections to this server via the IP has the same error result as:

cURL error 7: Failed to connect to port 1234: Connection refused

I tried adding this option too, but it did not solve the problem:

Only when I put as a bined RPC IP, Bitcoin core returns true response. I've checked many pages but did not find any other appropriate way to allow some certain IPs to Bitcoind. May you help me please?

Note: IP, Port number, username and password are changed from real values.

  • 1
    You should never, ever be exposing your RPC port. You wouldn't pass your banking information in cleartext, why would you do the same with your bitcoin credentials? The option shouldn't be in Bitcoin Core at all honestly.
    – Claris
    Feb 9, 2020 at 10:48
  • @Anonymous, we defined a secret port number for JSON RPC connections, and only we know what is it. What's the problem here? Feb 9, 2020 at 11:30
  • 1
    It takes tens of seconds scan all 65535 ports on a host. The entire internet, every one of the 281474976710656 ports, is scanned constantly, even by public services like shodan.io. The idea that your port is "secret" is comical, especially in the context of it being a security measure.
    – Claris
    Feb 9, 2020 at 11:39
  • Our platform is on the server 1 and the Bitcoin core has installed on the server 2. We receive requests from users on the server 1 and have to ask server 2 to do them. Do you have any other solution? Feb 9, 2020 at 11:42
  • 3
    If your solution is to transmit key material in plaintext over the internet, maybe you should find a job that isn't engineering security sensitive services that handle other people's money. Assuming you don't take that advice, consider using a VPN to connect the two together.
    – Claris
    Feb 9, 2020 at 11:43

1 Answer 1


If your server is behind a NAT or otherwise does not have as the IP address for one of the network interfaces, then rpcbind= won't work. You can check what IP addresses your node actually has using ifconfig and then rpcbind=<ip> for one of those.

For example, because my node is behind my router's NAT, I have to do rpcbind= instead of binding to my external IP of

  • We are not behind a NAT and the given IP is the true one. Feb 9, 2020 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.