Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have some doubt about DNS Query.
In short:
1. Whether device should make DNS Query for LocalHost(127.0.0.1 OR ::1)?
2. If DNS Server doesn't respond anything against DNS Query, how long device should wait for response.
In Detail:
I am performing software testing of one embedded device. I observed delay of 8 seconds, while executing one specific task. By analyzing the issue observed that, device is performing DNS Query for the Localhost. DNS Server is not responding to the query made, device waits for 8 seconds and then proceed further.
My doubt here,
1. What is better option, whether device should make DNS Query for LocalHost or save LocalHost entry in the host.conf.
Any security concern for saving entry in the host.conf?
2. If server do not respond to the query, how long device should wait? Whether device should retransmit the query or fallback to secondary DNS Server or fallback to host.conf
1. Whether device should make DNS Query for LocalHost(127.0.0.1 OR ::1)?
Not to be pedantic about it but it's not the device performing a ('man 3 gethostbyaddr;') query but software...
Quote:
Originally Posted by jwalanttrivedi
2. If DNS Server doesn't respond anything against DNS Query, how long device should wait for response.
Milliseconds. Please first check if the default IPv4 and IPv6 localhost entries were added to the top of /etc/hosts. (Also see /etc/host.conf, /etc/nsswitch.conf, /etc/resolv.conf, NSCD, dnsmasq, pdns_recursor.)
Thanks unSpawn for update.
I understood that depending on the order set in the host.conf, client device software may do query for localhost.
But still I have doubt on second part, if server doesn't respond the query, what should be behavior of the client software? Whether client should resend the query after how much interval and when client should give up?
(..) I have doubt on second part, if server doesn't respond the query, what should be behaviour of the client software? Whether client should resend the query after how much interval and when client should give up?
Short answer: it's TCP stack behaviour, so subject to RCFs. rfc1536 for example suggests ISC BIND stub uses "an interval that starts at the greater of 4 seconds and 5 seconds divided by the number of servers the resolver queries" which seems slow by "modern" standards. Obviously you can check timings yourself for any common UNIX (sub)system or user land app and glean nfo from that?..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.