dnsmasq Essentials

Linux Logo

dnsmasq Essentials

dnsmasq is a lightweight DNS, DHCP, router advertisement and network boot application

Install

sudo apt install dnsmasq
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
dnsmasq
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 16.5 kB of archives.
After this operation, 75.8 kB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian buster/main armhf dnsmasq all 2.80-1+rpt1+deb10u1 [16.5 kB]
Fetched 16.5 kB in 1s (16.8 kB/s)  
Selecting previously unselected package dnsmasq.
(Reading database ... 181264 files and directories currently installed.)
Preparing to unpack .../dnsmasq_2.80-1+rpt1+deb10u1_all.deb ...
Unpacking dnsmasq (2.80-1+rpt1+deb10u1) ...
Setting up dnsmasq (2.80-1+rpt1+deb10u1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /l
ib/systemd/system/dnsmasq.service.
Processing triggers for systemd (241-7~deb10u7+rpi1) ...

Configure dnsmasq

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
sudo nano /etc/dnsmasq.conf

Sample Config

interface=eth1
dhcp-range=192.168.99.200,192.168.99.220,255.255.255.0,24h

Check DHCP Leases

cat /var/lib/misc/dnsmasq.leases
1627870969 32:e6:77:66:bb:33 192.168.66.219 clientx 11:ff:e6:d7:66:bf:ff

Start dnsmasq

sudo systemctl start dnsmasq

Stop dnsmasq

sudo systemctl stop dnsmasq
,