Skip to content

Instantly share code, notes, and snippets.

@arzumy
Created November 12, 2009 16:10
Show Gist options
  • Save arzumy/233015 to your computer and use it in GitHub Desktop.
Save arzumy/233015 to your computer and use it in GitHub Desktop.
# Credit goes to Geoff Hankerson
# Original tutorial http://geoffhankerson.com/node/108
# This is a short version just for personal reference
# 1. Create key
sudo rndc-confgen -a
# 2. Add zone in named.conf
sudo vim /etc/named.conf
# Paste this in
zone "site.local" IN {
type master;
file "site.local";
};
# 3. Create the zone file
sudo vim /var/named/site.local
# Paste this in
site.local. 7200 IN SOA site.local. root.site.local. (
2008031801 ; Serial
15 ; Refresh every 15 minutes
3600 ; Retry every hour
3000000 ; Expire after a month+
86400 ) ; Minimum ttl of 1 day
@ IN NS site.local.
@ IN MX 10 site.local.
@ IN A 127.0.0.1
* IN A 127.0.0.1
# 4. Check if everything is cool
sudo named-checkconf /etc/named.conf
sudo named-checkzone site.local /var/named/site.local
# 5. Add 127.0.0.1 as DNS/nameserver in Network.prefpane
# 6. Launch BIND
sudo launchctl load -w /System/Library/LaunchDaemons/org.isc.named.plist
# 7. Verify with dig
dig site.local
dig awesome.site.local
ping awesome.site.local
# 8. If new zone added, restart with this
sudo launchctl stop org.isc.named
sudo launchctl start org.isc.named
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment