Page 1 of 1

gethostbyname implementation

Posted: Fri Feb 03, 2006 10:34 am
by carbonBased
I'm in need of writting an implementation of gethostbyname() and would like to see a sample implementation or, at the very least, a good look at the protocol that is required.

Does anybody have such information? Googling continually gets me code that's using an OSs native gethostbyname which is useless to me.

Thanks,
Jeff

Re:gethostbyname implementation

Posted: Fri Feb 03, 2006 10:45 am
by Pype.Clicker
the protocol required is DNS (domain name service). "gethostbyname" typically try to get the "resolve" information from several libraries, including reading /etc/hosts file, then "libnss_dns" ...

You should find all the required information for implementation in RFCs (www.ietf.org)