Using dnsmasq for local DNS caching

Asked by Tong Sun

Hi,

I'm following https://help.ubuntu.com/community/Dnsmasq to config my dnsmasq. I've done everything, but still can't get DNS from local caching server. Here are the details:

I've done everything:

$ grep domain-name-servers /etc/dhcp3/dhclient.conf
prepend domain-name-servers 127.0.0.1;
. . .

$ grep listen-address /etc/dnsmasq.conf
listen-address=127.0.0.1

$ cat /etc/resolv.conf
nameserver 127.0.0.1
nameserver 192.168.0.1

See, all the configuration done. Now:

% service dnsmasq restart
 * Restarting DNS forwarder and DHCP server dnsmasq [ OK ]

$ dig ubuntu.com
;; Query time: 8 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
   ^^^^^^^^^^^^^^^^^^^

$ dig ubuntu.com
;; Query time: 53 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
   ^^^^^^^^^^^^^^^^^^^

DNS request is still going through 192.168.0.1.

FYI, local DNS caching is working fine:

$ dig debian.org @localhost
;; Query time: 69 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)

$ dig debian.org @localhost
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
   ^^^^^^^^^^^^^^^^^^^

Please help

thx

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu dnsmasq Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Tong Sun (suntong001) said :
#1

This is Ubuntu 10.10 Maverick,
and please use changing configuration file for solution as appose to using GUI if possible.

thanks

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

Can you give the output of:

cat /etc/resolv.conf

Thanks

Revision history for this message
Tong Sun (suntong001) said :
#3

OMG, didn't you see that I've already posted that pal:

$ cat /etc/resolv.conf
nameserver 127.0.0.1
nameserver 192.168.0.1

Now, having the above tweak and doing a reboot, my eth0 is not started any more. How should I enable my eth0 by default.

Revision history for this message
Tong Sun (suntong001) said :
#4

> my eth0 is not started any more

$ cat /etc/networks
# symbolic names for networks, see networks(5) for more information
link-local 169.254.0.0

$ cat /etc/NetworkManager/nm-system-settings.conf
# This file is installed into /etc/NetworkManager, and is loaded by
# NetworkManager by default. To override, specify: '--config file'
# during NM startup. This can be done by appending to DAEMON_OPTS in
# the file:
#
# /etc/default/NetworkManager
#

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

I use dnsmasq myself in this way, all I changed was the listen address, I didn't change any other file. Do you use a netowkr management app, or do you just edit the network config files manually?

Revision history for this message
Tong Sun (suntong001) said :
#6

>
> Do you use a netowkr management app, or
> do you just edit the network config files manually?
>

I just edit the network config files manually, no GUI involved.

Revision history for this message
Launchpad Janitor (janitor) said :
#7

This question was expired because it remained in the 'Open' state without activity for the last 15 days.