Skip to content

Instantly share code, notes, and snippets.

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 viviparous/bee0108376966efb02671aaab4de2afe to your computer and use it in GitHub Desktop.
Save viviparous/bee0108376966efb02671aaab4de2afe to your computer and use it in GitHub Desktop.
Configure dnsmasq from scratch on Debian
Assumption: you know how to install dnsmasq, and you have done so.
##############################/etc/default/dnsmasq
#contains useful information
#IGNORE_RESOLVCONF=yes
##############################/etc/resolv.conf
domain home
search home
nameserver 127.0.0.1
#############################/etc/resolv.dnsmasq
#opendns
nameserver 208.67.222.222
nameserver 208.67.220.220
############################/etc/dnsmasq.conf
#test the config using sudo dnsmasq --test
#disable dns
#port=0
#XXX == This machine
listen-address=127.0.0.1,192.168.1.XXX
#where to find the list of additional domains to block
#format: 0.0.0.0 baddomain
#addn-hosts=/etc/banner_add_hosts
addn-hosts=/etc/dnsmasq_addn_hosts_blockfile.txt
log-queries
#log-facility=/etc/dnsmasq.log
# Include another lot of configuration options.
conf-file=/etc/dnsmasq.more.conf
#conf-dir=/etc/dnsmasq.d
# Include all the files in a directory except those ending in .bak
#conf-dir=/etc/dnsmasq.d,.bak
# Include all files in a directory which end in .conf
#conf-dir=/etc/dnsmasq.d/*.conf
cache-size=10000
#pointer to list of upstream DNS
#no-resolv
resolv-file=/etc/resolv.dnsmasq
#set interface
interface=eth0
local-ttl=300
log-async
domain-needed
bogus-priv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment