Posts tagged: DNS

Adding a DNS nameserver to OS X Leopard

To add a DNS nameserver to OS X Leopard

Summarized from these excellent articles, Overriding DHCP- or VPN-assigned DNS servers in Mac OS X Leopard, Updating OS X Network Settings to Use a Local DNS Server, and Using a Local DNS Server in Leopard

In OS X (Leopard and later) DNS entries are arranged as a hierarchy – general to specific. You need the most specific applicable entry. Order – general to specific. Output is from scutil list command.

  • State:/Network/Global/DNS
  • Setup:/Network/Service/0/DNS (Fixed Network Adapter)
  • State:/Network/Service/B5DD6BDA-F1B3-40C7-9CEC-03CF97DE7B0A/DNS (Airport Connection)
  • State:/Network/Service/com.cisco.VPN/DNS (CISCO VPN)

So, now for the commands to adjust everything

sudo scutil
list State:/Network/Service/[^/]+/DNS
[Pick the appropriate service]
show State:/Network/Service/com.cisco.VPN/DNS
[
 {
  ServerAddresses :  {
    0 : 10.1.10.211
    1 : 10.1.10.100
  }
}
]
d.init
get State:/Network/Service/com.cisco.VPN/DNS
d.add ServerAddresses 10.1.10.74 10.1.10.211 10.1.10.100
d.show
[
 {
  ServerAddresses :  {
    0 : 10.1.10.74
    1 : 10.1.10.211
    2 : 10.1.10.100
  }
}
]
set State:/Network/Service/com.cisco.VPN/DNS
^D

Remember to flush your local DNS cache after all is said and done:

(Leopard and later) dscacheutil -flushcache

OS X Flush DNS Cache

To flush the  DNS cache in OS X (as superuser):

lookupd -flushcache (Tiger)
dscacheutil -flushcache (Leopard and later)

DNS Record Formats

DNS Resource Records – Useful chapter on an online book.

Bind on RedHat

BIND on RedHat – I

BIND on RedHat – 2

These instructions worked except for the points noted below. You must change the serial number in the zone file initially and after every subsequent change else BIND will not see the changes.

Serial numbers must increase and not exceed a maximum – easiest is to use YYYYMMDDNN format. If you use this format and edit with emacs, emacs automatically increments the number for you.

Also, zone file changes have to be copied from /var/named to /var/named/chroot/var/named.

Start/stop/reload bind service

/etc/init.d/named [start|stop|reload]

WordPress Themes