LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-22-2005, 05:57 AM   #1
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Rep: Reputation: 30
'dig' command


I did a dig and I get this

Quote:
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45318
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;pureraire.com.sg. IN A

;; ANSWER SECTION:
pureraire.com.sg. 21600 IN A 202.157.134.114

;; AUTHORITY SECTION:
pureraire.com.sg. 21600 IN NS ns2.webvis.net.
pureraire.com.sg. 21600 IN NS ns1.webvis.net.

;; ADDITIONAL SECTION:
ns1.webvis.net. 172791 IN A 202.157.163.157
ns2.webvis.net. 172791 IN A 202.157.131.118

;; Query time: 68 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Jun 22 11:15:43 2005
;; MSG SIZE rcvd: 128

Whats the diff between Authority and Additional?

Quote:
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49068
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1

;; QUESTION SECTION:
;hwzcorp.com. IN A

;; ANSWER SECTION:
hwzcorp.com. 24824 IN A 202.79.222.20

;; AUTHORITY SECTION:
hwzcorp.com. 24824 IN NS ns4.phing.com.
hwzcorp.com. 24824 IN NS ns3.phing.com.

;; ADDITIONAL SECTION:
ns4.phing.com. 38697 IN A 202.79.222.3

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Jun 22 17:56:09 2005
;; MSG SIZE rcvd: 103


One concern I have, over another domain name (above), the additional section only contains one nameserver... how come?
And ns3.phing is suppose to be primary.. why is it 2nd? Does it matter?

My concerns maybe anal.. so please pardon me as i clear all these nitty gritty doubts
 
Old 06-22-2005, 06:47 AM   #2
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
Authority records are nameservers in charge of the record you requested. Additional records are just that: various other records gven for your convenience, such as the ip's of authorities. They are completely optional, and, strictly speaking, they could be anything.
Nameservers are returned in random order, it is to do some sort of load-balancing.
 
Old 06-28-2005, 03:18 AM   #3
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
then how does DNS work?

Does it...

1) ALways query Primary Server. Only query secondary if primary is down

2) ALternate between primary and secondary?


Thanks
 
Old 06-28-2005, 06:57 AM   #4
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
It depends... Use a packet sniffer such as tcpdump or ethereal to be sure... I've often seen computers query the primary server then, after 0.5 seconds, query the secondary server. This behavior is not defined in dns and depends only on your resolver. Experiment with it.
 
Old 07-06-2005, 10:50 PM   #5
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by stefan_nicolau
It depends... Use a packet sniffer such as tcpdump or ethereal to be sure... I've often seen computers query the primary server then, after 0.5 seconds, query the secondary server. This behavior is not defined in dns and depends only on your resolver. Experiment with it.
This packet sniffer software you're talking.. are they windows software?

Guess I get concerned because I realise only the domains I setup points the nameserver the otherway round...

on dig, the domains under me always show the secondary one first,.. or sometime.. just the secondary ones only!


others that i know of... theirs always primary one first.. then secondary
 
Old 07-07-2005, 04:37 AM   #6
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
Quote:
This packet sniffer software you're talking.. are they windows software?
No.
Would I post Windows-only software on this forum?
www.ethereal.org

Quote:
Guess I get concerned because I realise only the domains I setup points the nameserver the otherway round...

on dig, the domains under me always show the secondary one first,.. or sometime.. just the secondary ones only!


others that i know of... theirs always primary one first.. then secondary
If I understand well, you are concerned that computers you set up query the secondary nameserver first? Look at /etc/resolv.conf. You will realize there are no 'primary' and 'secondary' nameservers, only nameservers.
 
Old 07-20-2005, 06:25 AM   #7
Swakoo
Member
 
Registered: Apr 2005
Distribution: Red Hat / Fedora / CentOS
Posts: 508

Original Poster
Rep: Reputation: 30
meaning to say... there's no cause for concern? whether 'secondary' or 'primary'?

So for nameservers for domains.. does it work as such?

1) It will query 'primary' server until it fails, then to the next one


2) It will alternate between 'primary' and 'secondary' (or even more) periodically?

Just curious... cos i have cases whereby i set the dns correct in the 1st one but not 2nd (secondary) one.. it took a week before it suddenly fail (cannot resolve domain name)

thus i was wondering.. how exactly does dns work...
 
Old 07-20-2005, 11:47 AM   #8
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
Quote:
meaning to say... there's no cause for concern? whether 'secondary' or 'primary'?
Unless the two servers don't resolve the same name to the same ip (and vice-versa). This will only happen if you manage your own primary zones, and happen to have made a configuration mistake that makes both servers think that they are primary servers for the same zone.

Quote:
1) It will query 'primary' server until it fails, then to the next one
2) It will alternate between 'primary' and 'secondary' (or even more) periodically?
Check for yourself with a sniffer. On my system, it tries the first nameserver listed in /etc/resolv.conf until it fails. Please note however that there are no "primary" and "secondary" nameservers in the resolver configuration, just nameservers.

Quote:
thus i was wondering.. how exactly does dns work...
Did you search google for "dns"?

Quote:
Just curious... cos i have cases whereby i set the dns correct in the 1st one but not 2nd (secondary) one.. it took a week before it suddenly fail (cannot resolve domain name)
If you only have one (properly) configured nameserver, you are vulnerable to problems.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
nslookup/dig command not found Axion Slackware 8 02-11-2010 07:23 PM
DIG command information sonika_singhi Linux - Networking 1 10-27-2004 08:18 AM
dig command questions DNS emailssent Linux - Networking 2 09-24-2004 10:27 AM
dig command questions DNS emailssent Linux - Networking 3 09-22-2004 06:56 AM
dig command dunkyb Linux - Software 1 05-19-2003 01:01 PM


All times are GMT -5. The time now is 04:06 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration