OpenDNS has a resource record setup so if you request that record it will return the IP address (ref).
So you can use a command like this host myip.opendns.com 208.67.222.222
and the result you will get will be the IP address of computer you are using, or the public address used by the NAT you are behind.
What I would like to know is if there are any open source DNS servers that can perform this function as well.