- May
- 13,191
- 180
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).
Using "2>NUL" to get rid of "Non-authoritative answer:" and wrapping it up in a couple TCC functions, I now have this.
I suppose I'll further wrap that up into an alias or a user-defined function.
I'd love to see other solutions.
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.