Skip to content

Instantly share code, notes, and snippets.

@SalmonKing72
Created April 30, 2020 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SalmonKing72/7009cde8180566bd4d124ceb9eb953f0 to your computer and use it in GitHub Desktop.
Save SalmonKing72/7009cde8180566bd4d124ceb9eb953f0 to your computer and use it in GitHub Desktop.
Local DNS Database on Pihole machine

In terms of getting started quickly I ended up using a pihole deployment with extra lists, as described in https://www.youtube.com/watch?v=qNCzSA2bs9I

In this solution you get ad-block as "unnecessary" extra, but maybe it is more people than me who don't mind.

Start by installing pihole on some machine as described here https://github.com/pi-hole/pi-hole/#one-step-automated-install and get it up and running.

When you're finished with getting pihole to work, extend the pihole configuration as below (example on a debian system, with a .lan domain):

Create a file /etc/dnsmasq.d/02-lan.conf with content

addn-hosts=/etc/pihole/lan.list Then create another file /etc/pihole/lan.list containing your local mappings, such as

192.168.1.100 nas.lan 192.168.1.101 somethingelse.lan if you e.g. have a nas sitting at 192.168.1.100.

Conclude by restarting the piholes dns service using sudo pihole restartdns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment