Making use of dnsmasq-base

Asked by Tong Sun

Hi,

I noticed that the Ubuntu, at least in 10.10 Maverick, comes default with dnsmasq-base:

 dnsmasq-base A small caching DNS proxy and DHCP/TFTP server

However, neither /etc/dnsmasq.conf nor /usr/local/etc/dnsmasq.conf of the dnsmasq config file exist in the system. Moreover,

cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.0.1

This truly indicates that a local caching DNS proxy is not used.

So I think the dnsmasq-base is merely taking up disk space without doing anything. Do you think so as well?
How can I make use of it?

thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu dnsmasq Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

Definately use it, makes web access faster due to not using the web for all DNS resolutions if the name is already known.

You should also run:

sudo apt-get install dnsmasq; gksudo gedit /etc/resolv.conf

Find this line:
#listen-address=
and change it to:
listen-address=127.0.0.1

Then use your network management app to set the interface to DHCP (Address only), then set the DNS to:

127.0.0.1, 192.168.0.1

(remember to select "apply to all users") and click apply, you will need to authenticate and your connection will disconnect, reconnect the interface.

You can test with:

dig www.bmezine.com | grep -i query; sleep 5; dig www.bmezine.com | grep -i query

The second request takes 0ms to resolve as the IP in stored in the system. The cache will be lost on reboot but it will rebuild back up again

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

> gksudo gedit /etc/resolv.conf
>
> Find this line:
> #listen-address=
> and change it to:
> listen-address=127.0.0.1

Are you sure it is "/etc/resolv.conf"?

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

Sorry, it's

gksudo gedit /etc/dnsmasq.conf

Nice spot

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

Thanks actionparsnip, that solved my question.