This tool can figure out your public IP address, both for IPv4 and for IPv6. It can also detect DNS leaks.
For DNS leaks, read this article.
It queries public nameservers that return the IP.