Simple IP Dispenser Update
dhcpdnsdnsmasq2022-04-15 - carpie

Five years ago, I wrote an article about configuring DNSmasq to let you control who gets on your network and what address is assigned to them. The technique still works today. It is a bit of a pain to manually edit in addresses though. So, I created the Simple Ip Dispenser, or SID for short, to help with this. It monitors the DHCP requests and, through an android app, lets you allow a request and give it a specific host name. That works fine, but I never really liked the android app for interfacing with it.

So, I have finally created SID 2.0. It's basically the same as before, but simplified. It also includes it's own web user interface, so it's a single package, no android app needed! You just point your web browser at your DNS server and do the configuration there.

Let's look how to install and use it. This article assumes you are using the dnsmasq configuration from my previous DHCP/DNS article, where we configured dnsmasq to only give addresses to devices we specifically allowed.

First, we ssh into our raspberry pi DNS server...

ssh pi@dnsserver

Let's grab the SID package from my gitlab account and install it with dpkg... (Please check the releases page as a newer version may be available!)

wget https://gitlab.com/carpie/sid/uploads/f38f34b1052bc796f5091399ae346af1/sid_2.0.0_all.deb
sudo dpkg -i sid_2.0.0_all.deb

SID is preconfigured to run with the default setup from my DNS video, so if you are using that unchanged, it's ready to go. If you want to change things though, you can do so by running

sudo dpkg-reconfigure sid

The prompts here are self-explanatory. We just need to enter the configuration that matches our DNSmasq setup. The two new items here are the port the SID UI listens on and the PIN to authenticate with the SID UI. Both default to 4253, but, of course, we can change them if desired.

When making changes be sure to restart SID.

sudo systemctl restart sid

From our computer or phone, we can now go to the IP of our DNS server at https://192.168.0.2:4253 and we'll get the log in page. There we just put in the PIN and it takes us to the monitor page. If there were any outstanding DHCP requests for devices that do not already have addresses, we'd see them there.

In the example below, I've tried to connect to the network with my phone. After hitting the refresh button in the upper right corner, the request shows up.

Address request

If we click on the request, we have the opportunity to add a host name. I just called it myphone in this case.

Assigning IP/hostname

After clicking Assign, SID tells me that my phone has an IP of 192.168.0.11 and a hostname of myphone.

IP/hostname assigned

That's all there is to it! This saved us from having to hand edit the reservations configuration and from having to restart dnsmasq. Just a bit of convenience. Adding other devices would work this same way.