Advertisement

Error 500 Bad Host Name?

Started by July 21, 2004 03:16 PM
7 comments, last by FireNet 20 years, 6 months ago
Alright, i have this script that is supposed to update my ip with my dns server: #!/usr/bin/perl -w use strict; use LWP::UserAgent; use URI; my $ADDR = "http://dynamic.registerfly.com/?domain=pcgametech.com&password=notforyoutoknow&host="; my $url = URI->new('http://dynamic.registerfly.com/?domain=pcgametech.com'); my $ip; my $ua = new LWP::UserAgent; my $data; my $response; my $req; my $res; my @data; my $content; my $linksyspass = "notforyoutoknow"; $ua = new LWP::UserAgent; $req = new HTTP::Request GET => 'http://192.168.1.1/st_poe.htm'; $req->authorization_basic('',$linksyspass); $res = $ua->request($req); if ( $res->is_success ) { @data = split /<tr/, $res->as_string; } else { print "Error!\n"; exit 1; } foreach $data (@data) { if ( $data =~ /IP Address:/ ) { $data =~ s/<\/td><\/tr>//g; $data =~ s/<(.)*>//; $ip = substr($data, 23); } } open(IN, "</root/update.txt"); $content = <IN>; close(IN); open(OUT, ">/root/update.txt"); print OUT "$ip"; close(OUT); if ($ip eq $content) { print "its the same.\n"; } if ($ip ne $content) { $response = $ua->get("$ADDR@&ipaddress=$ip"); if ($response->is_error() ){ print "Error: ", $response->status_line, "\n"; } else { print "It worked?"; } $response = $ua->get($ADDR."www&ipaddress=".$ip); if ($response->is_error() ){ print "Error: ", $response->status_line, "\n"; } else { print "This worked too?"; } print "it changed\n"; } print "IP $ip updated successfully\n"; print "$ADDR@&ipaddress=$ip"; print "host:", $url->host(),"\n"; print "port:", $url->port(),"\n"; The problem is the first time i ran it it returned Error 500 bad host name. It worked a while but know it doesnt and returns this. Im completely lost due to these inconsistent errors.
We all think that we are the best with computers but we all keep reffering to the same all-mighty all-knowing Guru, Google.
I don't know perl, but that sounds like you didn't fill in the "Host: " part of the HTTP request. E.g. "Host: www.gamedev.net\r\n"
I don't know if perl needs that set explicity though, and I can't understand any of that code :P
Advertisement
The host part does not need to be explicitly set but can be edited if its not what you want. THe problem is its telling me error 500 bad hostname dynamic.registerfly.com and that is the host that i want so im confused. This script worked and then the power went out and when the server turned back on the script stopped working.
We all think that we are the best with computers but we all keep reffering to the same all-mighty all-knowing Guru, Google.
Heres something to consider. When i put://dynamic.registerfly.com it goes to where i want. 209.223.101.26 is the ip that this url comes out to when i look it up. I should be able to substitute dynamic.registerfly.com with 209.223.101.26. Instead it takes me somewhere else. Shouldnt all web addresses be able to be substituted with an ip?
We all think that we are the best with computers but we all keep reffering to the same all-mighty all-knowing Guru, Google.
Well yes and no,

You see dynamic.registerfly.com is a sub domanin of registerfly.com.So when you try to connect to a sub-domain you are infact connecting to the main domain and then then the main domain transffers you to the location or gets the data to you.

This is quite a simplistic explanation but with domains and IP getting gobbled up (the number or IPs are limited) things like port forwarding are getting common.Also this involves diffrent hardware/software like routers,firewalls etc to get the stuff done.It's a bit complex.

Hey but there is some good news,we are now using IPv4 but when IPv6 becomes standard the number of IP available will be in billions.

IPv6
-----
http://www.ipv6.org/
http://playground.sun.com/pub/ipng/html/ipng-main.html
http://www.cisco.com/warp/public/732/Tech/ipv6/

(P.S This is the web,and it's all over the place,in a mess ;-))
______________________________________________________________________________________________________
[AirBash.com]
So back to my original question, how do i use ips to get a good host name? This error is really bugging me and its getting annoying. Btw, its funny cause i was just looking into IPv6 and it sounds promising. The thing i want to know about it is will i be able to get my own ip without having to pay extra to my dsl provider so then i wont have to worry about a ddns script.
We all think that we are the best with computers but we all keep reffering to the same all-mighty all-knowing Guru, Google.
Advertisement
You can convert an IP into a hostname or a hostname into an IP using DNS.

Anyway,about IPv6.It's going to take a few years before it becomes wide spread and available in all countries.About you having to pay your provider more money to get a IPv6 IP when it is available, is entirely upto them.

Still we will have to wait to see the trends as to how people,ISPs,oragnization etc. react and use IPv6 before we say too much.I personally feel it going to take time as no ISP will just throw out equipmet or a established system.They will keep it as long as possible and gradually switch over.

So the best bet is that if you want IPv6 as soon as your ISP starts providing it,you may have to pay something or you can even switch over to and ISP which already offers IPv6.

Better wait a bit though.

______________________________________________________________________________________________________
[AirBash.com]
Whether your ISP will give you a dynamic IP, or a static IP, is up to the ISP, not to the number assignment authority.

Also, I wouldn't hold my breath for IPv6 to take over the world anytime soon. The transition cost is just too high; there's too much equipment to upgrade or replace which nobody wants to pay for. Meanwhile, IPv4 works great, and NAT is only a marginal annoyance in the business environment.

enum Bool { True, False, FileNotFound };
Exactly,

Let's speculate 5-8 years is a very short time for IPv6 to become popular.

The Internet is a web,all over the place, in a mess
______________________________________________________________________________________________________
[AirBash.com]

This topic is closed to new replies.

Advertisement