How does dig find my WAN-IP-address? What is "" doing?

First to summarize the general usage of dig: it requests the IP assigned to the given domain from the default DNS server. So e.g. dig would request the IP assigned to the domain That would be

The command you mentioned is:

dig +short

So what this command does is: it sends a request for the IP of the domain to the DNS server This server is programmed that, if this special domain is requested, the IP the request comes from is sent back.

The reasons why the method of querying the WAN IP using DNS is better were mentioned by krinkle: standardised, more stable and faster.

The reason I could imagine for those two IPs is that your router caches DNS requests and returns an old IP.

Another problem could be DualStack Lite. That is often used by new internet contracts. Do you know whether your ISP is using DS Lite?

This free service has been shut down by Cisco. Payed it might still work.

Google provides the same service.


dig -4 TXT +short

or ipv6

dig -6 TXT +short