DNSMasq
- This document covers the compilation, installation and basic configuration of the DNSMasq DNS "relay" server. More advanced configuration is covered in the help file for DNSMasq and on the DNSMasq website.
- If you install this software it is highly recommended that you keep up-to-date with security advisories published on the CERT website.
- I cannot be held responsible for the security of your DNSMasq server. It is up to you to understand the software you are running. The setup detailed here is that of a basic DNS relay and nothing more.
- If you spot any major errors on this page, please e-mail me using the link above.
- It is assumed that this installation takes place on a computer on which Core Linux has been successfully installed.
- No software other than the packages bundled with Core Linux have been installed.
- As described in the installation guide, it is assumed that any downloaded application source code is stored in a directory called
/appson the CD-R. - It is assumed that the Core Linux computer is attached to a network on which there is at least one other machine with internet access and a CD burner. It must also be running an DNS client program, for example a web browser or FTP client.
Preparation
- Download the DNSMasq source code from www.thekelleys.org.uk/dnsmasq/.
- Burn the file
dnsmasq-1.10.tar.gzto a CD. This page assumes that the subdirectory/appsis used for the.tar.gzfile. The CD-ROM can be a multi-session disk.
Booting
- Boot your Core Linux PC.
- Login as
root. You will need to enter the password at the prompt.
Extract the source
- Place the CD-R in the CD-ROM drive. Mount the CD-ROM drive under
/mnt/cdrom. - Change to the
/appsdirectory on the CD-R. - Copy the
dnsmasq-1.10.tar.gzfile to the directory/usr/src. - Change to the
/usr/srcdirectory and extract the source from the.tar.gzfile.
Configure and compile
- Change to the
/usr/src/dnsmasq-1.10directory. - Run the
makeprogram with the argumentinstall.
Testing
- Configure the upstream DNS servers for your Core Linux system.
- Add the user
nobody. - Start the DNSMasq daemon using
/usr/local/sbin/dnsmasq --log-queries. - Set your other computer to use your Core Linux system as its only DNS server.
- Make a DNS lookup from the client computer (e.g. try to open a web page in a web browser using its domain name).
- Check logs on your Core Linux system to ensure that DNSMasq performed the query correctly.
Automating DNSMasq
- Append the following line to the
/etc/rc.d/rc.muscript:You should adjust the above line to reflect the options with which you want DNSMasq to run. You can also add comments and echoes for your own information./usr/local/sbin/dnsmasq -q - Insert the following line at the second line of the
/etc/rc.d/rc.rbscript:You can also add comments and echoes for your own information.kill `cat /var/run/dnsmasq.pid` - Insert the following line at the second line of the
/etc/rc.d/rc.hascript: - Reboot the system and check that DNSMasq is running.

The text of this page is licensed under a Creative Commons License.
