Why is curl using the wrong IP address to resolve this hostname?

I had a DNS A record that resolved mydomain.com to 1.1.1.1.*

* names and IP addresses changed to protect the innocent :P

I recently modified the record to resolve the name to 2.2.2.2. I can confirm that the change was made on my Ubuntu 17.04 desktop with:

$ dig a mydomain.com
...
;; ANSWER SECTION:
mydomain.com. 1091 IN A 2.2.2.2

However, curl doesn't resolve the name to the correct IP address:

$ curl -vvv mydomain.com
* Rebuilt URL to:
* Trying 1.1.1.1...
...

The contents of /etc/resolve.conf:

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 10.10.0.1
nameserver 127.0.0.53

10.10.0.1 is the IP address of my router on the local network. It is configured to use the DNS servers 8.8.8.8 and 8.8.4.4 (Google's public DNS servers). I used this page to flush the DNS entries for the domain and the page indicated that the procedure was a success.

However, curl continues to resolve to the wrong address - how can I fix this?

2

1 Answer

It takes a while (up to 48 hours if I'm not mistaken) for the DNS servers to refresh. Flushing the DNS cache won't help of the server is still pointing to the wrong IP.

Edit: you can try this service to check the propagation of your DNS update.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like