User Tools

Site Tools


dnsmasq

Table of Contents

In /etc/dnsmasq.conf, ensure conf-dir is set to /etc/dnsmasq.d

Then, in dnsmasq.d, create a new config file:

no-dhcp-interface=ens5  # Disable DHCP
bogus-priv  # Rev lookup for IP is not sent upstream
domain=test.dev  # My domain name
expand-hosts  #  Host names will have domain name added
local=/test.dev$/  # Queries for this domain are only answered by dnsmasq; dont resolve externally
domain-needed  # dont forward plain names without dots to upstream
no-resolv  # Dont use /etc/resolv.conf as upstream
no-poll  # Similar to above
server=8.8.8.8
server=8.8.4.4

#no-hosts  # To skip /etc/hosts
#addn-hosts=  # To use a different file than /etc/hosts

#bind-interfaces  # Listen to specific interface, not all
#listen-address=127.0.0.1  # Interface address on which to listen

For DHCP

dhcp-range=192.168.0.1,192.168.0.10,12h  # Range and lease time
dhcp-option=3,192.168.0.254  # Router
dhcp-host=the-mac-address,ip-address  # For fixed IPs
# See /var/lib/misc/dnsmasq.leases

For tftp

enable-tftp
tftp-root=/var/mytftp
#tftp-no-fail  # If tftp-root is unavailable, dont fail
#tftp-secure  # Serve only files owned by the user dnsmasq is running as

# tftp commands # connect 127.0.0.1 # get filename # quit # put filename

For PXE boot

interface=_  # Get from ifconfig or "networkctl list"
dhcp-range=_
dhcp-boot=pxelinux.0  # This is a symbolic link for debian-installer
enable-tftp
tftp-root=_

bogus-priv
expand-hosts
no-resol
server=8.8.8.8

In the TFTP root directory, download the TGZ (netboot.tar.gz for Debian) and extract.

Use a bridged adapter, if dnsmasq is running on a VM.

dnsmasq.txt · Last modified: by reddy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki