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
gethostbyname implementation
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:gethostbyname implementation
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)
You should find all the required information for implementation in RFCs (www.ietf.org)