I have a domain name’s DNS configured with cloudflare that sets the A record to my public IP address (I’ve set DDNS so I can SSH onto my raspberry pi if my dynamic IP ever changes). However, for some reason I cannot seem to ssh onto my pi using my domain name.

This way works (both with my public or private IP on port 4321):

ssh [email protected].***.*** -i ./.ssh/rpi_key -p 4321

However, for some reason this doesn’t work:

ssh [email protected] -i ./.ssh/rpi_key -p 4321

Why does this happen, and how can I get SSH to work using my domain name rather than IP? Cloudflare clearly points the IP to 2.127.. so I assume this should be completely identical.

cloudflare dns records

Also, after browsing some other posts, they suggest running this command: dig +short "mycustomdomain.co.uk" @, which returns the following:


I’d assume it should return the IP associated with that domain name (my public IP, 2.127..), but instead it returns different IPs and 2 of them. Am I incorrect here? I can only assume otherwise they return the NS IPs of Cloudflare.

What am I not getting here? Thanks for any help

  • 1
    looks like a DNS propagation issue - i.e. your Dynamic IP address isn't propagating throughout the DNS system in a timely manner Commented May 20, 2021 at 2:02
  • But why is the dig command returning 2 different IPs? If it's a propagation issue then would I need to just wait a bit longer for the problem to fix itself? Commented May 20, 2021 at 9:27

1 Answer 1


For anyone else having this it turns out that the problem was Cloudflare's DNS settings set to being proxied; changing to DNS only works

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.