Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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?
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
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
$ sudo netstat -lunp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 127.0.0.1:11211 0.0.0.0:* 1541/memcached
udp 0 0 0.0.0.0:538 0.0.0.0:* 1533/gdomap
udp 0 0 127.0.0.1:53 0.0.0.0:* 10363/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 10359/dhclient
udp 0 0 0.0.0.0:68 0.0.0.0:* 1569/dhclient
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 ----------
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]).
$ dig www.yahoo.com
; <<>> DiG 9.8.1-P1 <<>> www.yahoo.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21969
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.yahoo.com. IN A
;; ANSWER SECTION:
www.yahoo.com. 0 IN CNAME fd-fp3.wg1.b.yahoo.com.
fd-fp3.wg1.b.yahoo.com. 0 IN CNAME ds-fp3.wg1.b.yahoo.com.
ds-fp3.wg1.b.yahoo.com. 0 IN CNAME ds-any-fp3-lfb.wa1.b.yahoo.com.
ds-any-fp3-lfb.wa1.b.yahoo.com. 0 IN CNAME ds-any-fp3-real.wa1.b.yahoo.com.
ds-any-fp3-real.wa1.b.yahoo.com. 9 IN A 126.96.36.199
;; Query time: 132 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Jan 9 09:44:10 2013
;; MSG SIZE rcvd: 158
See the server serving the query?
Last edited by eantoranz; 01-09-2013 at 08:16 AM.
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.