Home   Archive   Permalink



how do you get the ip address attached to my machine

I have a windows xp machine.
    
how can I get the IP address attached to my machine?
    
what is the command to do that?

posted by:   yuem       29-May-2010/22:57:37-7:00



read join dns:// read dns://

posted by:   Nick       29-May-2010/23:51:19-7:00



That's for your local IP. You can get your WAN IP using:
    
parse read http://guitarz.org/whatismyip.cgi [thru "< ip >" copy p to "< /ip >" ]
    
; (remove the spaces in the "ip" tags).
    
to-tuple trim p

posted by:   Nick       29-May-2010/23:56:30-7:00



thanks nick.

posted by:   yuem       30-May-2010/7:44:08-7:00



Here is another one, it is just returns your IP adress, no html output.
    
ip: to-tuple read http://www.whatismyip.com/automation/n09230945.asp


posted by:   Endo       30-May-2010/8:53:37-7:00



thanks Endo

posted by:   yuem       30-May-2010/10:09:42-7:00



The link above is a REBOL CGI script (that particular one is by Graham), so can be configured to return in any format desired :)

posted by:   Nick       30-May-2010/11:04:48-7:00



Try this one:
    
to-tuple read http://guitarz.org/ip2.cgi

posted by:   Nick       30-May-2010/11:46:12-7:00



And the one at http://guitarz.org/ip3.cgi is even simpler. Here's the source:
    
#!/home/path/rebol -cs
R E B O L []
print "Content-type: text/html^/"
prin system/options/cgi/remote-addr
quit

posted by:   Nick       30-May-2010/11:49:50-7:00