Getting the public IP of a FIOS router

#1
I'm new to FIOS. So far it's working well. Since I run an FTP server, I need to know the public IP address of my router. It's cumbersome to HTTP to the modem, give a password, and read the IP from the screen. Google turned up this command (with output).
Code:
v:\> nslookup -type=a myip.opendns.com resolver1.opendns.com
Server:  resolver1.opendns.com
Address:  208.67.222.222

Non-authoritative answer:
Name:    myip.opendns.com
Address:  71.176.70.208
Using "2>NUL" to get rid of "Non-authoritative answer:" and wrapping it up in a couple TCC functions, I now have this.

Code:
v:\> echo %@word[1,%@execstr[4,nslookup -type=a myip.opendns.com resolver1.opendns.com 2>nul]]
71.176.70.208
I suppose I'll further wrap that up into an alias or a user-defined function.

I'd love to see other solutions.
 
Likes: Bob Chapman
#4
I think it works like this. Both NSLOOKUP and DIG are told to use the DNS server resolver1.opendns.com. And that seems to be a real DNS server.
Code:
v:\> dig +short lucky.syr.edu @resolver1.opendns.com
128.230.13.36
That's correct, though I don't know why my former employer hasn't removed that record; it's almost a year out of date.

What's special is the name "myip.opendns.com". When that name is queried, resolver1.opendns.com returns the IP from which the query came. It's so simple that I wonder why such a mechanism isn't universally implemented by DNS servers.