Dennis wrote:
> I'm new to Rebol but was wondering if  there is anyway I can use it to
> find out the ip address of the machine it's running on. I have been
> losing my connection to the internet and when the machine reconnects it
> gets a new ip address. I would like to use Rebol to then update some
> html with this new ip address.

Hi Dennis,

I fished this out of the archive... It was a discussion we had about 
two months ago.  It gets a little convoluted, but it does properly 
change the IP address.  system/network/host-address doesn't change 
when you get your new IP address, reading dns:// does.

[--Insert old posting--]
> At 09:46 PM 8/12/99 +0200, you wrote:
> >Hi fellow rebols,
> >
> >does someone know wether it is possible to get the 
> >hostname/ip-address of the machine rebol is running on?
> 
> >> print system/network/host-address
> 127.0.0.1
> >> print system/network/host
> knobel

You can also use the DNS protocol, though going direct to the system
object is quicker:

To get the hostname:
>>print read dns://
sarnoff

To get the IP address:
(This is the same as doing: print read dns://sarnoff)
>>print read rejoin [ dns:// read dns:// ]
206.191.108.253

To get the FQDN:
(This is the same as doing: print read dns://206.191.108.253)
>>print read rejoin [dns:// read rejoin [dns:// read dns://] ]
sarnoff.insinc.ca

Kev

------------------------------------------------------------------------
Kevin McKinnon, System Administrator/Chief Engineer        [EMAIL PROTECTED]
Interactive Netcasting Systems, Inc.                http://www.insinc.ca

      "If God meant man to fly, He'd have given him more money."

PGP Public Key: http://www.dockmaster.net/pgp.html   PGP 6.0 www.pgp.com

Reply via email to