LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   'dig' command (https://www.linuxquestions.org/questions/linux-newbie-8/dig-command-336032/)

Swakoo 06-22-2005 04:57 AM

'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

stefan_nicolau 06-22-2005 05:47 AM

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.

Swakoo 06-28-2005 02:18 AM

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

stefan_nicolau 06-28-2005 05:57 AM

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.

Swakoo 07-06-2005 09:50 PM

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

stefan_nicolau 07-07-2005 03:37 AM

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.

Swakoo 07-20-2005 05:25 AM

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...

stefan_nicolau 07-20-2005 10:47 AM

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.


All times are GMT -5. The time now is 03:24 PM.