Get your public IP using DNS


Some Open DNS operators provide a way to return the IP address of the request packet.

Google DNS:

dig txt +short


dig +short


$ dig +short TXT
"ns" "2001:db8::abcd"
"ecs" ""
"ip" "" 

The ds stands for dual stack. It is also reachable under to force IPv6 or to force IPv4.

ns stands for the unicast IP address of the recursive resolver. ecs contains the EDNS client subnet information if the resolver uses the option. In this case, ip contains a representative IP within the ECS, not necessarily the IP of the client.

The new version is introduced in this blog post

The old version might be decommissioned:

dig +short