sudo apt update
sudo apt install dnsmasq
Replace test
with your domain and xxx.xxx.xxx.xxx
with your local ip address
sudo echo "local=/test/" > /etc/dnsmasq.d/test
sudo echo "address=/test/xxx.xxx.xxx.xxx" >> /etc/dnsmasq.d/test
sudo systemctl restart dnsmasq
sudo nano /etc/systemd/resolved.conf
Find:
#DNS=
#FallbackDNS=
Replace with:
DNS=127.0.1.1
FallbackDNS=127.0.1.1
sudo systemctl restart systemd-resolved
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: test.test
Address: xxx.xxx.xxx.xxx
Note the Address: xxx.xxx.xxx.xxx
should be our ip.
Global
DNS Servers: 127.0.1.1
...
Note the DNS Servers: 127.0.1.1