LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-30-2016, 02:56 PM   #1
jwalanttrivedi
LQ Newbie
 
Registered: Jul 2016
Posts: 2

Rep: Reputation: Disabled
DNS Query for LocalHost


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
 
Old 07-31-2016, 04:32 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by jwalanttrivedi View Post
I have some doubt about DNS Query.
Welcome to LQ, hope you like it here.


Quote:
Originally Posted by jwalanttrivedi View Post
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 View Post
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.)
 
Old 08-08-2016, 10:21 AM   #3
jwalanttrivedi
LQ Newbie
 
Registered: Jul 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
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?
 
Old 08-09-2016, 07:53 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by jwalanttrivedi View Post
(..) 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?..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iterative Query DNS and Recursive Query DNS !!!!! jitendra.sharma Linux - Newbie 1 09-05-2013 02:38 AM
forwarding DNS query to another DNS server pedenski Linux - Newbie 6 05-16-2013 08:56 AM
Redirect local DNS query to remote DNS server on non standard port? rock_ya_baby Linux - Server 8 04-13-2010 04:31 AM
dns requests from localhost to localhost keex Linux - Networking 2 11-13-2003 01:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration