Created
May 22, 2013 15:12
-
-
Save robwilkerson/5628350 to your computer and use it in GitHub Desktop.
Installs DNSMasq. Tested in a Vagrant shell provisioner for a Ubuntu 12.04 VM.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installing dnsmasq so that loopback communication using the site URL doesn't fail. | |
if [ ! -e '/etc/dnsmasq.conf' ]; then | |
echo -n "Installing and configuring DNSMasq..." | |
apt-get install dnsmasq -qq -y > /dev/null 2>&1 | |
cat >> /etc/dnsmasq.conf << "EOF" | |
address=/.umassmemorial.org/127.0.0.1 | |
listen-address=127.0.0.1 | |
EOF | |
sed -i -r -e 's/^(\s*)#(\s*prepend domain-name-servers\s+.*)$/\1\2/' /etc/dhcp/dhclient.conf | |
service dnsmasq restart > /dev/null | |
else | |
echo "DNSMasq is already installed (and presumably configured)." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment