View Single Post
Old 01-10-2015, 03:30 AM   #1
Lanthum
Member
 
Join Date: Oct 2002
Location: Suburbs of Chicago
Posts: 138
Lanthum is on a distinguished road
Send a message via MSN to Lanthum
Resolving IP addresses

While programming the IP resolution code for incoming connections on my project mud, a from-scratch C++ project in which use I 'getnameinfo', I noticed that my host name didn't resolve (into "somewhere.internet.com") and I got the string of the IP instead (something like 123.456.789.012). When I tested it from the localhost, the host name resolved. The man page states its normal behavior for 'getnameinfo' to return the string IP if the resolution fails. But I was curious, so I took a look through the logs on my Rom2.4 mud (which uses gethostbyaddr instead) and noticed that it appears the IP addresses don't get resolved on at least 60-70% of the connections there.

I'm not sure if it's always been this way and I never noticed before, or if this is abnormal behavior ... but should I be getting the human-readable form of the location of the connection more than ~30-40%? Does anyone know how, exactly, the resolution request works, and why some names don't resolve? Not knowing what's really going on behind the scenes, I would think that "success" should be much higher than what I'm seeing ...

Thanks
Lanthum is offline   Reply With Quote