Results 1 to 5 of 5
I have two questions on the linux (DNS) resolver library, any help appreciated.
1. DNS client queries are handled via the resolver library. Does this involve any form of queuing ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-14-2005 #1Just Joined!
- Join Date
- Jun 2005
- Posts
- 2
resolver library (DNS)
I have two questions on the linux (DNS) resolver library, any help appreciated.
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?
2. is there any way to force gethostbyname() to use a particular DNS server rather than what's in resolv.conf?
Thankyou.
- 06-14-2005 #2
Re: resolver library (DNS)
"Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy
- 06-14-2005 #3Just Joined!
- Join Date
- Jun 2005
- Posts
- 2
Thanks, sarumont. I should explain that the reason I'm asking is that I've written a client that tests latency of a DNS server by querying it at a configurable interval. My client constructs a UDP packet in the correct format and sends it to the DNS. I did it this way specifically to avoid any caching or funny behaviour in resolver libraries.
I would now like to write a version of the client using gethostbyname() or similar. The point is that I am running many instances of this client on the one host to test various different DNS hosts in our network. I therefore need to be able to tell each instance of my client which DNS to use.
- 06-18-2005 #4Awesome. Feel free to post your testing results.
Originally Posted by Mudhoney
"Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy
- 09-11-2008 #5Just Joined!
- Join Date
- Feb 2006
- Location
- Pittsburgh
- Posts
- 32
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?


Reply With Quote
