Dnsmasq

Revision as of 02:16, May 16, 2015 by Threesixes (Talk | contribs)

net-dns/dnsmasq


Source Repository:Funtoo Overlay
Homepage

Summary: Small forwarding DNS server

Use Flags

conntrack
Add support for Linux conntrack connection marking.
dhcp
Enable support for reading ISC DHCPd lease files
script
Enable support for calling scripts when leases change
tftp
Enables built in TFTP server for netbooting

News

Drobbins

Pre-built kernels!

Funtoo stage3's are now starting to offer pre-built kernels for ease of install. read more....
12 May 2015 by Drobbins
Drobbins

Better Experiences: Ego and Vim

Info on Funtoo's new personality tool called 'ego', and user-focused updates to vim's defaults.
27 April 2015 by Drobbins
Drobbins

How We're Keeping You At the Center of the Funtoo Universe

Read about recent developments that keep you, our users, at the forefront of our focus as Funtoo moves forward.
10 April 2015 by Drobbins
View More News...

Dnsmasq

Tip

This is a wiki page. To edit it, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Warning

As this page deals with DNS it has the potential to break your internet access! Ensure you have stable live media that can restore your system.

Dnsmasq is a dns cache, dhcp, and pxe server. This package is lightweight, and will work well for individual computers, or small lans.

Installation

# emerge net-dns/dnsmasq


Configuration

/etc/dnsmasq.conf is where most of dnsmasq's configuration is done. It's file is well commented, and ready for several scenarios.

DNS only

Important

place other upstream dns servers in /etc/resolv.dnsmasq.conf with your preferred DNS server at the top of the list. The first console command in the block will wipe out existing /etc/resolv.dnsmasq.conf settings, back them up if you have anything important in them.

# echo "nameserver 8.8.8.8" > /etc/resolv.dnsmasq.conf


/etc/dnsmasq.conf - insert local dns only configs at the bottom of the dnsmasq.conf file.
...
resolv-file=/etc/resolv.dnsmasq.conf
listen-address=127.0.0.1

To listen to a DNS server on an alternate port: In this example we'll install dnscrypt-proxy (package not on wiki - please add):

/etc/dnsmasq.conf - insert local dns only configs at the bottom of the dnsmasq.conf file.
...
#resolv-file=/etc/resolv.dnsmasq.conf
server=127.0.0.1#2053
listen-address=127.0.0.1

Now your localhost / 127.0.0.1 is your primary DNS to point net connection scripts to. This is the point of no return command. Start the service before you run this, and be prepaired to test with dig that it's pulling up servers through dnsmasq.

# echo "nameserver 127.0.0.1" > /etc/resolv.conf


This is the revert to known working DNS servers command:

# echo "nameserver 8.8.8.8" > /etc/resolv.conf


Runtime

# rc-update add dnsmasq default
# rc


Testing

DNS only

Bind-tools contains dns testing utilities. To verify that dns requests are returned from the local server: emerge bind-tools, then run:

# dig google.com | grep -i server
;; SERVER: 127.0.0.1#53(127.0.0.1)