You are not logged in.

#1 2012-10-11 02:44:59

headkase
Member
Registered: 2011-12-06
Posts: 1,976

[Solved] How to list which DNS I am using?

Edit, solution to find which DNS you are using.  Install:

sudo pacman -S dnsutils

To get the "dig" command.  Then use it:

dig http://www.google.ca

And at the bottom of the output you will see

SERVER:

Which is immediately followed by the DNS you are using.

Thank you x33a.

---
Original post:

I'm trying to use Google DNS which are 8.8.8.8, and 8.8.4.4.  I have a pure systemd installation and have the dhcpcd service unit active:

dhcpcd@eth0.service                           loaded active running       dhcpcd on eth0

In my /etc/dhcpcd.conf file I have the following:

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Inform the DHCP server of our hostname for DDNS.
hostname
# To share the DHCP lease across OSX and Windows a ClientID is needed.
# Enabling this may get a different lease than the kernel DHCP client.
# Some upstream DHCP servers may also require a ClientID, such as FRITZ!Box.
#clientid

# A list of options to request from the DHCP server.
#option domain_name_servers, domain_name, domain_search, host_name
option domain_name, domain_search, host_name
option classless_static_routes
nooption domain_name_servers
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook resolv.conf
nohook lookup-hostname
noipv4ll

With the only changes being "nooption domain_name_servers" and "nohook resolv.conf".

Then in my /etc/resolv.conf I have the nameservers:

# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
nameserver 8.8.8.8
nameserver 8.8.4.4
#nameserver 192.168.0.1
# /etc/resolv.conf.tail can replace this line

/etc/resolv.conf has had "chattr +i" done to it to make it immutable from changes.

I think I have it all set-up correctly, as in it all works, but I do not know of an explicit command to tell me exactly which DNS I am using.

Last edited by headkase (2012-10-13 14:53:54)

Offline

#2 2012-10-11 02:47:58

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] How to list which DNS I am using?

What if you use something that traces the resolution... tracepath I think.

Offline

#3 2012-10-11 02:52:35

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] How to list which DNS I am using?

Thanks for the reply WonderWoofy, that gets me:

tracepath -n -b www.google.ca
 1:  192.168.0.100 (192.168.0.100)                         0.101ms pmtu 1500
 1:  192.168.0.1 (192.168.0.1)                             0.715ms pmtu 1492
 
[Redacted details]
 
 6:  no reply
^C

And I don't see anything that looks like a DNS address there??

Last edited by headkase (2012-10-11 04:02:07)

Offline

#4 2012-10-11 03:02:32

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] How to list which DNS I am using?

Well, I don't know if this is at all relevent, but mine always hits the gateway twice.  That is, my router is set handle the DNS resolving, so I think that is what it is doing?  Not sure though... I am purely speculating.

Offline

#5 2012-10-11 03:05:01

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] How to list which DNS I am using?

I just gave every DDOS'er out there my IP address.. wink  Ok, I'll wait for more suggestions.  Thank you WonderWoofy.

Last edited by headkase (2012-10-11 03:05:11)

Offline

#6 2012-10-11 03:19:54

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] How to list which DNS I am using?

At one point I remember using namebench to deterimine whether or not there were faster DNS servers around me.  I think I also remember it telling me what DNS server I was currently using.


Edit: It is in the AUR, and indeed, it told me that I am using 10.0.0.1 (my ISP) and that it was the fastest.

Last edited by WonderWoofy (2012-10-11 03:28:31)

Offline

#7 2012-10-11 03:30:40

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] How to list which DNS I am using?

Ok, installed namebench from AUR.  When I run it my list is prepopulated with 8.8.8.8 and 8.8.4.4 and then below that it has a checkmark to "test global servers like Google DNS..."  So, I am led to believe that I did set up my nameservers properly as given in the original post.  They were also referenced with a "SYS" prefix which also lends credence.  I am hoping for a rock-solid command line program however that will list the DNS.  Then I could put that in the first post and mark it solved..

Offline

#8 2012-10-11 03:35:27

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] How to list which DNS I am using?

WonderWoofy,

Look at this screenshot: http://imgur.com/EssEX

Where mine are prepopulated with 8.8.8.8 and 8.8.4.4 are yours prepopulated with 10.0.0.1?  If so then I would say that my DNS is correctly setup..

Offline

#9 2012-10-11 03:38:30

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] How to list which DNS I am using?

From what I just experienced, I would think that the pre-population as you are referring to it, is indeed what is currently being used.  Mine had only 10.0.0.1, which is exactly what is in my resolv.conf, and what I already knew and expected to be using.  Also, I actually ran the test, and it told me that my current settings were optimal (maybe not in those exact words), indicating that 10.0.0.1 was the fastest.

Offline

#10 2012-10-11 03:39:27

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] How to list which DNS I am using?

Ok, thank you - good enough for me! smile  Marking as solved.

If you're getting your readings out of resolv.conf and so am I then I do believe that I have configured the original post files correctly!

Last edited by headkase (2012-10-11 03:40:28)

Offline

#11 2012-10-11 03:46:21

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] How to list which DNS I am using?

Excellent!  Glad I could help.

Offline

#12 2012-10-11 04:00:53

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] How to list which DNS I am using?

I switched my nameservers over to OpenDNS: http://www.opendns.com/
Because they have a test page: http://www.opendns.com/welcome/

And I got a successful result.  So, to change that all I modified were the nameserver numbers in "/etc/resolv.conf".  So, I assume that I configured "/etc/dhcpcd.conf" correctly.  With the OpenDNS nameservers those now come up as prepopulated in namebench too.  Thanks again, solved.

Offline

#13 2012-10-13 12:30:07

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [Solved] How to list which DNS I am using?

Don't forget OpenDNS redirects dns queries when it can't resolve the name, so you can expect random breakage without apparent cause.

If you are concerned about speed then you might want to look at using dnsmasq to cache frequent dns requests.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#14 2012-10-13 12:59:21

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] How to list which DNS I am using?

Once I knew that the DNS changes were taking proper effect I switched back to Google DNS.  Thanks though! smile

Offline

#15 2012-10-13 14:45:10

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [Solved] How to list which DNS I am using?

Just in case you are still curious to know which exact dns responds to your queries, use the dig command.

$ dig archlinux.org

See the SERVER line at the bottom.

And there's also the nslookup command.

Last edited by x33a (2012-10-13 14:45:38)

Offline

#16 2012-10-13 14:54:22

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] How to list which DNS I am using?

x33a wrote:

Just in case you are still curious to know which exact dns responds to your queries, use the dig command.

$ dig archlinux.org

See the SERVER line at the bottom.

And there's also the nslookup command.

Thank you, updated first post.

Offline

Board footer

Powered by FluxBB