Verbose DNS query to see DNS query order?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I typically determine the IP of a host by doing: $ host -t A example.com
. Is there a more verbose version of this that tells me what's happening in the background, specifically the order of what is queried (/etc/hosts 1st, dns server 2nd)?
As many people can attest to, OS X Lion resolves local /etc/hosts
entries painfully slowly, and I'd like to see what bottlenecks are causing this. Seems like in theory, /etc/hosts
should be queried first and name resolution should happen instantaneously for manually entered hosts.
networking osx dns dnsmasq
add a comment |Â
up vote
3
down vote
favorite
I typically determine the IP of a host by doing: $ host -t A example.com
. Is there a more verbose version of this that tells me what's happening in the background, specifically the order of what is queried (/etc/hosts 1st, dns server 2nd)?
As many people can attest to, OS X Lion resolves local /etc/hosts
entries painfully slowly, and I'd like to see what bottlenecks are causing this. Seems like in theory, /etc/hosts
should be queried first and name resolution should happen instantaneously for manually entered hosts.
networking osx dns dnsmasq
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I typically determine the IP of a host by doing: $ host -t A example.com
. Is there a more verbose version of this that tells me what's happening in the background, specifically the order of what is queried (/etc/hosts 1st, dns server 2nd)?
As many people can attest to, OS X Lion resolves local /etc/hosts
entries painfully slowly, and I'd like to see what bottlenecks are causing this. Seems like in theory, /etc/hosts
should be queried first and name resolution should happen instantaneously for manually entered hosts.
networking osx dns dnsmasq
I typically determine the IP of a host by doing: $ host -t A example.com
. Is there a more verbose version of this that tells me what's happening in the background, specifically the order of what is queried (/etc/hosts 1st, dns server 2nd)?
As many people can attest to, OS X Lion resolves local /etc/hosts
entries painfully slowly, and I'd like to see what bottlenecks are causing this. Seems like in theory, /etc/hosts
should be queried first and name resolution should happen instantaneously for manually entered hosts.
networking osx dns dnsmasq
networking osx dns dnsmasq
edited Sep 23 '16 at 11:10
Jeff Schaller
32.6k849110
32.6k849110
asked May 14 '12 at 18:56
mmla
485147
485147
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
Since Apple has done away with nsswitch.conf
in Lion, you can view the resolver order with scutil --dns
.
My guess is you will see "DNS" listed before "local".
It's a bit of a hack, but you can install DNSMasq on your OS X host and have your system query it for DNS resolution. DNSMasq can read /etc/hosts
first and serve up the entries it finds there before searching DNS. This restores the proper order to resolution.
The gentleman who wrote this blog has done all of the hard work for you. He describes how to install DNSMasq and configure it on OS X Lion.
This is very helpful. Thank you!
â mmla
May 15 '12 at 3:53
1
... Why in the name of Saint Carl the Far-Seeing and Saint Frederick the Compassionate did they dump a perfectly functional resolution mechanic in exchange for scutil ?
â Shadur
May 15 '12 at 8:25
@Shadur just remember they have their own keyboard layout and have given up on non-glossy displays, that should suffice to understand...
â Shadok
May 15 '12 at 12:09
@Shadur Ask Different. apple.stackexchange.com :)
â George M
May 15 '12 at 12:48
add a comment |Â
up vote
0
down vote
I find dig
particularly useful in that realm. The default output is verbose and shows what is being done (what gets sent and what is received.)
There is an example:
alex$ dig m2osw.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> m2osw.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52965
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;m2osw.com. IN A
;; ANSWER SECTION:
m2osw.com. 85160 IN A 138.197.205.139
;; Query time: 18 msec
;; SERVER: 75.75.75.75#53(75.75.75.75)
;; WHEN: Sun Aug 19 18:02:58 PDT 2018
;; MSG SIZE rcvd: 54
alex$
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Since Apple has done away with nsswitch.conf
in Lion, you can view the resolver order with scutil --dns
.
My guess is you will see "DNS" listed before "local".
It's a bit of a hack, but you can install DNSMasq on your OS X host and have your system query it for DNS resolution. DNSMasq can read /etc/hosts
first and serve up the entries it finds there before searching DNS. This restores the proper order to resolution.
The gentleman who wrote this blog has done all of the hard work for you. He describes how to install DNSMasq and configure it on OS X Lion.
This is very helpful. Thank you!
â mmla
May 15 '12 at 3:53
1
... Why in the name of Saint Carl the Far-Seeing and Saint Frederick the Compassionate did they dump a perfectly functional resolution mechanic in exchange for scutil ?
â Shadur
May 15 '12 at 8:25
@Shadur just remember they have their own keyboard layout and have given up on non-glossy displays, that should suffice to understand...
â Shadok
May 15 '12 at 12:09
@Shadur Ask Different. apple.stackexchange.com :)
â George M
May 15 '12 at 12:48
add a comment |Â
up vote
3
down vote
Since Apple has done away with nsswitch.conf
in Lion, you can view the resolver order with scutil --dns
.
My guess is you will see "DNS" listed before "local".
It's a bit of a hack, but you can install DNSMasq on your OS X host and have your system query it for DNS resolution. DNSMasq can read /etc/hosts
first and serve up the entries it finds there before searching DNS. This restores the proper order to resolution.
The gentleman who wrote this blog has done all of the hard work for you. He describes how to install DNSMasq and configure it on OS X Lion.
This is very helpful. Thank you!
â mmla
May 15 '12 at 3:53
1
... Why in the name of Saint Carl the Far-Seeing and Saint Frederick the Compassionate did they dump a perfectly functional resolution mechanic in exchange for scutil ?
â Shadur
May 15 '12 at 8:25
@Shadur just remember they have their own keyboard layout and have given up on non-glossy displays, that should suffice to understand...
â Shadok
May 15 '12 at 12:09
@Shadur Ask Different. apple.stackexchange.com :)
â George M
May 15 '12 at 12:48
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Since Apple has done away with nsswitch.conf
in Lion, you can view the resolver order with scutil --dns
.
My guess is you will see "DNS" listed before "local".
It's a bit of a hack, but you can install DNSMasq on your OS X host and have your system query it for DNS resolution. DNSMasq can read /etc/hosts
first and serve up the entries it finds there before searching DNS. This restores the proper order to resolution.
The gentleman who wrote this blog has done all of the hard work for you. He describes how to install DNSMasq and configure it on OS X Lion.
Since Apple has done away with nsswitch.conf
in Lion, you can view the resolver order with scutil --dns
.
My guess is you will see "DNS" listed before "local".
It's a bit of a hack, but you can install DNSMasq on your OS X host and have your system query it for DNS resolution. DNSMasq can read /etc/hosts
first and serve up the entries it finds there before searching DNS. This restores the proper order to resolution.
The gentleman who wrote this blog has done all of the hard work for you. He describes how to install DNSMasq and configure it on OS X Lion.
answered May 14 '12 at 20:30
George M
8,79623247
8,79623247
This is very helpful. Thank you!
â mmla
May 15 '12 at 3:53
1
... Why in the name of Saint Carl the Far-Seeing and Saint Frederick the Compassionate did they dump a perfectly functional resolution mechanic in exchange for scutil ?
â Shadur
May 15 '12 at 8:25
@Shadur just remember they have their own keyboard layout and have given up on non-glossy displays, that should suffice to understand...
â Shadok
May 15 '12 at 12:09
@Shadur Ask Different. apple.stackexchange.com :)
â George M
May 15 '12 at 12:48
add a comment |Â
This is very helpful. Thank you!
â mmla
May 15 '12 at 3:53
1
... Why in the name of Saint Carl the Far-Seeing and Saint Frederick the Compassionate did they dump a perfectly functional resolution mechanic in exchange for scutil ?
â Shadur
May 15 '12 at 8:25
@Shadur just remember they have their own keyboard layout and have given up on non-glossy displays, that should suffice to understand...
â Shadok
May 15 '12 at 12:09
@Shadur Ask Different. apple.stackexchange.com :)
â George M
May 15 '12 at 12:48
This is very helpful. Thank you!
â mmla
May 15 '12 at 3:53
This is very helpful. Thank you!
â mmla
May 15 '12 at 3:53
1
1
... Why in the name of Saint Carl the Far-Seeing and Saint Frederick the Compassionate did they dump a perfectly functional resolution mechanic in exchange for scutil ?
â Shadur
May 15 '12 at 8:25
... Why in the name of Saint Carl the Far-Seeing and Saint Frederick the Compassionate did they dump a perfectly functional resolution mechanic in exchange for scutil ?
â Shadur
May 15 '12 at 8:25
@Shadur just remember they have their own keyboard layout and have given up on non-glossy displays, that should suffice to understand...
â Shadok
May 15 '12 at 12:09
@Shadur just remember they have their own keyboard layout and have given up on non-glossy displays, that should suffice to understand...
â Shadok
May 15 '12 at 12:09
@Shadur Ask Different. apple.stackexchange.com :)
â George M
May 15 '12 at 12:48
@Shadur Ask Different. apple.stackexchange.com :)
â George M
May 15 '12 at 12:48
add a comment |Â
up vote
0
down vote
I find dig
particularly useful in that realm. The default output is verbose and shows what is being done (what gets sent and what is received.)
There is an example:
alex$ dig m2osw.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> m2osw.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52965
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;m2osw.com. IN A
;; ANSWER SECTION:
m2osw.com. 85160 IN A 138.197.205.139
;; Query time: 18 msec
;; SERVER: 75.75.75.75#53(75.75.75.75)
;; WHEN: Sun Aug 19 18:02:58 PDT 2018
;; MSG SIZE rcvd: 54
alex$
add a comment |Â
up vote
0
down vote
I find dig
particularly useful in that realm. The default output is verbose and shows what is being done (what gets sent and what is received.)
There is an example:
alex$ dig m2osw.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> m2osw.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52965
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;m2osw.com. IN A
;; ANSWER SECTION:
m2osw.com. 85160 IN A 138.197.205.139
;; Query time: 18 msec
;; SERVER: 75.75.75.75#53(75.75.75.75)
;; WHEN: Sun Aug 19 18:02:58 PDT 2018
;; MSG SIZE rcvd: 54
alex$
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I find dig
particularly useful in that realm. The default output is verbose and shows what is being done (what gets sent and what is received.)
There is an example:
alex$ dig m2osw.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> m2osw.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52965
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;m2osw.com. IN A
;; ANSWER SECTION:
m2osw.com. 85160 IN A 138.197.205.139
;; Query time: 18 msec
;; SERVER: 75.75.75.75#53(75.75.75.75)
;; WHEN: Sun Aug 19 18:02:58 PDT 2018
;; MSG SIZE rcvd: 54
alex$
I find dig
particularly useful in that realm. The default output is verbose and shows what is being done (what gets sent and what is received.)
There is an example:
alex$ dig m2osw.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> m2osw.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52965
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;m2osw.com. IN A
;; ANSWER SECTION:
m2osw.com. 85160 IN A 138.197.205.139
;; Query time: 18 msec
;; SERVER: 75.75.75.75#53(75.75.75.75)
;; WHEN: Sun Aug 19 18:02:58 PDT 2018
;; MSG SIZE rcvd: 54
alex$
answered Aug 20 at 1:04
Alexis Wilke
854614
854614
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f38665%2fverbose-dns-query-to-see-dns-query-order%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password