Skip to content

Instantly share code, notes, and snippets.

@cee-dub
Created January 14, 2012 23:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cee-dub/1613339 to your computer and use it in GitHub Desktop.
Save cee-dub/1613339 to your computer and use it in GitHub Desktop.
Generic configuration files for *.#{hostname}.local wildcard DNS with dnsmasq and mDNSResponder
# Add domains for which you want to force to an IP address here.
# This is the magic sauce for making *.#{hostname}
# always route to the localhost
address=/#{hostname}/127.0.0.1
address=/#{hostname}/::1
mx-host=#{hostname},#{hostname},10
# Extra options that make dnsmasq play nice
log-queries
# Never forward plain names (without a dot or domain part)
domain-needed
# Never forward addresses in the non-routed address spaces.
bogus-priv
# Don't read /etc/resolv.conf or any other resolver files to
# find upstream DNS servers
no-resolv
# Listen only on loopback interface, on non-privileged port
# 5253 as an homage to Multicast DNS (mDNS) using 5353 UDP
port=5253
listen-address=127.0.0.1
listen-address=::1
# Provide only DNS service, disable DHCP and TFTP
no-dhcp-interface=
# See 'man 5 resolver' for details
nameserver 127.0.0.1
nameserver ::1
port 5253
domain #{hostname}
search_order 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment