Skip to content

Instantly share code, notes, and snippets.

@yfix
Forked from obfusk/README.md
Created October 2, 2015 11:10
Show Gist options
  • Save yfix/7bc8404e9e480659b8a1 to your computer and use it in GitHub Desktop.
Save yfix/7bc8404e9e480659b8a1 to your computer and use it in GitHub Desktop.
dnsmasq for internal network

Install on dev server

$ aptitude install dnsmasq

Wildcards

$ cat >> /etc/dnsmasq.d/dev  # choose any name
address=/dev.example.com/192.168.1.2
^D

Invididual hosts

$ cat >> /etc/hosts  # overrides foo.dev.example.com wildcard
192.168.1.3 foo foo.dev.example.com
^D

Network configuration

The computers on the internal network will need to set their nameserver to the ip of the dev server.

Notes

This configuration was tested on ubuntu 12.04; YMMV; 12.04 has resolvconf installed; resolv.conf has 127.0.0.1 as nameserver; see /var/run/dnsmasq/resolv.conf for the name servers dnsmasq uses.

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