Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Dyndns.org Updating Client

by TheFluffyOne (Beadle)
on Nov 24, 2003 at 19:42 UTC ( [id://309648]=note: print w/replies, xml ) Need Help??


in reply to Dyndns.org Updating Client

I tend to use:

use Socket; if ($ip = gethostbyname($domain)) { $ip = inet_ntoa($ip); print "IP address is $ip\n"; } else { print "Could not resolve name.\n"; }

Not amazing, but does the job :) I assume you're going out to "whatismyip.com" because the IP address you want is not the box you run the script on?

Gordon.

Replies are listed 'Best First'.
Re: Re: Dyndns.org Updating Client
by lithron (Chaplain) on Nov 24, 2003 at 20:29 UTC
    I like the code, and the concept. I'll change things when I get home and do an update. I use whatismyip.com because the computer I run the code on is behind a NAT. Then I let the NAT forward ports to my internal computers. Plus, for those that don't have a NAT, it always retrieves the correct world routeable IP address, instead of grabbing the first network card's IP. I believe the above code could easily replace my call to nslookup. Thank you so much :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://309648]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-03-19 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found