dnsmasq - so what is my dns server?
So, kubuntu 12.04 is using dnsmasq and I need to know what its DNSs are (configured through dhcp). Is there an easy way to know what they are without using a sniffer to see where DNS requests are being sent?
Thanks in advance. |
what do you mean by configured? as a dhcp client, nameservers are placed in /etc/resolv.conf, as a server, dnsmasq will relay to the servers in it's own resolv.conf file unless others are explicitly stated in dnsmasq.conf
|
Look at this:
Code:
$ cat /etc/resolv.conf |
Yep. I've looked.... sooooo....?
As above, look at dnsmasq.conf. |
Dude, thanks for your help but dnsmasq.conf doesn't look promising:
Code:
$ locate dnsmasq.conf |
i'm really unclear where dnsmasq is fitting into this and what you want to find out. in what way is kubuntu "using" dnsmasq? If you're starting and stopping dnsmasq then you can start it in debug mode and see what it finds to use.
As an alternative approach, just do a request and see if anything shows in netstat -panu |
Oh, that was the key question. I _can_ find out by using a sniffer (and I do). What I want to be able to do is find out what dns servers dnsmasq is using so that I can skip this step which requires admin privileges (which I do have on this host but anyway). It should be written somewhere, right? One file in /var, perhaps?
I'm running a find /var -exec grep to try to find out if there's a file which is holding the dns servers somewhere but it's still looking (some rather big postgres dbs on my host). |
dnsmasq will pick up the local servers in resolv.conf if there are any. otherwise they'll be in dnsmasq.conf, but I'd also imagine that it's going to revert to root name servers if none are actually defined?
|
But this host gets its dnsservers from dhcp not from static files.... and it's working, otherwise I'd be stuck with no name resolution so somewhere dnsmasq is getting fed with the dns servers coming from dhclient, somehow... which, by the way, I don't care about (the mechanics, that is) at the moment. I would just like to do a cat on a file (if there's any) where I could see what dns servers dnsmasq is using at the moment given that it's kept from /etc/resolv.conf.
By the way, in var, there are some lease files from dhclient holding the dnsservers plus some mentions in syslog. ---------- Post added 01-09-13 at 11:05 AM ---------- And that's about it. |
so dnsmasq is NOT the dhcp server... so why does dnsmasq have anything to do with the question in the first place?
|
What? Didn't you see my resolv.conf? It _is_ my dns server (ant it's working as a caching proxy [which, by the way, is how the box is set up after I installed kubuntu 12.4 on it and it's been like that ever since]).
Code:
$ dig www.yahoo.com |
I see where you are going. You think I'm using dnsmasq as dhcp/dns server for hosts being served on a network through dhcp. Oh, no... it's set up (as I said, by the kubuntu installation) to do caching of dns requests on my own host (as far as I can tell... I didn't set it up) and it's working cause it's using the dns servers that were received from my host's dhcp client when I connected to the network.
|
Well, it's hackish but I finally found a file where the dns servers are held.
dnsmasq is started by the dhcp client (using NetworkManager) like this: Code:
/usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.0.1 --conf-file=/var/run/nm-dns-dnsmasq.conf --cache-size=0 --proxy-dnssec Code:
$ cat /var/run/nm-dns-dnsmasq.conf |
Right, so NetworkManager manages dnsmasq in a config-less scenario, so it should be passing DNS IP's as commandline optiosn to dnsmasq..?
---------- Post added 09-01-13 at 02:35 PM ---------- damnit, too late! |
Sure, look at the parameters in the dnsmasq call.
Code:
--conf-file=/var/run/nm-dns-dnsmasq.conf ---------- Post added 01-09-13 at 11:38 AM ---------- LOL |
All times are GMT -5. The time now is 02:19 PM. |