Re: resolver library (DNS)
Quote:
Originally Posted by Mudhoney
1. DNS client queries are handled via the resolver library. Does this involve any form of queuing or caching in the local host? I have sniffed my connection and it seems a new query goes out for each call to gethostbyname(). Is this always the case? Is it guaranteed that the client will use this result or could it be given a result from a local cache in the operating system?
Linux does not default to caching DNS entries. You may, however, install some DNS caching servers such as dnrd or pdnsd.
Quote:
Originally Posted by Mudhoney
2. is there any way to force gethostbyname() to use a particular DNS server rather than what's in resolv.conf?
Change the nameservers in resolv.conf. 8)
How does the resolver work in Linux?
SO when a browser wants to pull up any random webpage, google.com for example, the first thing the browser needs to do is translate the dns name into an IP address in order to pass it down the stack. The name resolution on a windows box starts with the local resolver, which not only maintains a cache of it's own, but has the hosts file pre-loaded into the cache.
If the linux local resolver does not have a cache, I was wondering how it interacts with the hosts file, if at all. Is the process similar in linux?