https://thinkingeek.com/2020/06/06/loca ... h-dnsmasq/
1. install dnsmasq
- sudo apt install dnsmasq
2. Edit the dnsmasq.conf file
- sudo nano /etc/dnsmasq.conf
Now the file is heavily commented and can seem daunting at first but we only need to mess with a few settings,
so hang in there.
a. "uncomment" or remove the hastag from the following:
domain-needed
bogus-priv
no-resolv
b. Set your name servers, a bunch of choices but lots of people just use Google's servers at 8.8.8.8 and 8.8.4.4
server=8.8.8.8
server=8.8.4.4
c. Name your domain:
local=/mydomain/
domain=mydomain
d. Now if you are using DHCP then make the following changes, if not go to step 3.
dhcp-range=192.168.1.32,192.168.1.250,24h
dhcp-host=11:22:33:44:55:66,computer1,192.168.1.3 - Here you need the mac address from your device and tell dnsmasq to give it this name and this IP.
dhcp-host=21:22:33:44:55:67,computer2,192.168.1.4 - Add more entries if needed.
dhcp-host=31:22:33:44:55:68,computer3,192.168.1.5
dhcp-option=option:router,192.168.1.1
3. If not using DHCP then you can save and close the conf file and open /etc/hosts
Here you type in the ip-address and name you want for each computer on your network.
Save the file and restart dnsmasq.
- sudo service dnsmasq restart
You are now the owner of a local domain.
It hardly needs to be said but stick to naming your domain something unlikely to be found on the actual internet and never forward traffic to your DNS-Server.
Popcorn for all!
