Random web page?
Anton Vredegoor
anton at vredegoor.doge.nl
Fri Apr 18 05:22:21 EDT 2003
Roel Schroeven <j4nff5m02 at sneakemail.com> wrote:
>> But why do the DNS-lookup if it's possible to load a page using an ip?
>
>Because not all websites can be reached that way, due to virtual
>hosting. Take my website for example (don't look at it, it's really not
>interesting :) ). http://roelschroeven.net gives a normal webpage, while
>http://64.191.37.195 (which is the ip-address for that domain) gives a
>generic page (in this case something that shouldn't really be there IMHO).
Thanks a lot for pointing this out. I did the following test to
corroborate your explanation:
>>> socket.gethostbyaddr("64.191.37.195")
('kontiki.ion-web.com', [], ['64.191.37.195'])
>>> socket.gethostbyname("roelschroeven.net")
'64.191.37.195'
>>> socket.gethostbyname("kontiki.ion-web.com")
'64.191.37.195'
>>>
This is quite perplexing. My view of the internet is that it is like
a phonebook where it is possible to link each name to a number. I
forgot that sometimes a lot of people are living on the same address!
Also thanks to Terry for bringing this up, although it took another
post to make me understand what was meant. I guess I am back to the
drawing board now :-|
Anton
More information about the Python-list
mailing list