gethostbyname implementation

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
carbonBased

gethostbyname implementation

Post 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
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:gethostbyname implementation

Post 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)
Post Reply