On Mon, 22 Sep 2003 09:26:31 +0000, Ryan Ritten wrote:
> Stupid question time:
>
> ok... usually when i want to find out what my ip address is I go to
> www.whatismyip.com ... is reported my ip address to me. but when i went
> to www.whatismyipaddress.com (note that they are 2 different websites) it
> gave me a different ip address.
>
> Why is that? Do I have 2 ip addresses? I only ask this because my
> website isn't working... I think my ip address for my dns is wrong. but i
> can't figure out what my actual ip address is
>
> any ideas?
>
> -Ryan Ritten
Here is a perl script I wrote to find out your public(WAN IP) and private
IP. I use it to verify my dynamic DNS settings along with the command:
host mydomain.ca
Here is the script.
-----------
#!/usr/bin/perl
# This is a perl version of Robin Keir's IP2 at
http://keir.net/ip2.html
# it gets your Wan IP address and provate IP address if you have one
#
# This script is for GNU/linux and BSD if you are running windows, use Robin Keir's
# program at the site above.
#
# This script will print out your WAN address and name as seen from a host outside
# your internal network
# This is useful for those behind a NAT router and need to know the Internet view of
# your host, useful for various filesharing apps and IRC stuff
#
# The following is a list of servers you can use/try if you need to substitute
# the default ecerami.com address
#
#
http://ecerami.com/servlet/coreservl...owCGIVariables
#
http://www.sanford.com/introcgi/cgi-...e.pl?something
# http://www.mueloliva.es/cgi-bin/variables.cgi?'0024'
#
http://inetarena.com/cgi-bin/environment.pl?this=that
#
http://curry.edschool.virginia.edu/g.../cgi-test.html
#
http://www.cfhub.com/examples/cgi/
#
# This script was created by Douglas Clinton
(E-Mail Removed)
# It is disrtibuted inder the GNU GPL if it doesnt work send me an email
# If you think that this script has damaged your computer get a brain scan...it can't
#
# Douglas Clinton
use LWP::Simple;
# First lets get the info we need from our favorite site
@url=get("http://ecerami.com/servlet/coreservlets.ShowCGIVariables");
# This section Finds the match for the WAN IP
foreach $i (@url) {
if ($i =~ /(\d+)(\.\d+){3}/) {
@stuff = $i;
#print "$i";
$string = $i;
$string =~ s/<([^>]|\n)*>//g ; # removes html tags
@stuff = $string;
#print "\n$string";
}
}
@words = split " ", $string;
$raw_addr = $words[13];
$raw_name = $words[14];
$clean_addr = substr($raw_addr, 11, 13);
# this next line prints the your WAN address
print "$clean_addr\n";
$clean_name = substr($raw_name, 11, 45);
# this nest line prints your WAN name
print "$clean_name\n";
----------
THE END
----------
I hope that helps...let me know if you have any problems with it.
--
GNU/Linux is God
get used to it
(E-Mail Removed)
Linux User # 276385