> For the complete documentation index, see [llms.txt](https://0xpthree.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0xpthree.gitbook.io/notes/development/linux/dnsmasq-dhcp.md).

# Dnsmasq DHCP

Local DHCP server with `dnsmasq`.

```bash
» sudo apt install dnsmasq
» sudo vim /etc/dnsmasq.conf
» systemctl restart dnsmasq

## Logs & leases
» sudo journalctl -u dnsmasq.service
» cat /var/lib/misc/dnsmasq.leases

## Example config
» cat /etc/dnsmasq.conf
interface=eth1
dhcp-range=192.168.1.100,192.168.1.100,255.255.255.0,12h
dhcp-option=option:router,192.168.1.1
dhcp-option=option:dns-server,192.168.1.1
dhcp-authoritative
```
