Pages

Saturday, January 14, 2012

Updating AD DNS from Mac OS X or Linux

I've got a Mac in an AD environment with DHCP.  All the Windows machines end up with the right DNS in the domain.  Mine doesn't, so my command prompt always has someone else's PTR.  The AD admins set me up so the DC will honor my DNS updates without auth.  (Thanks guys!)  In this example, my machine is tron.sub.domain.com at 192.168.0.42.  Here's how I use nsupdate interactively, one command at a time, in a terminal, to restore reality:
  nsupdate
  > update delete tron.sub.domain.com A
  > send
  > update delete 42.0.168.192.in-addr.arpa PTR
  > send
  > update add tron.sub.domain.com 86400 IN A 192.168.0.42
  > send
  > update add 42.0.168.192.in-addr.arpa. 86400 IN PTR tron.sub.domain.com.
  > send
  > quit
nsupdate will take commands from a file or stdin, so one-liners and scripts are easy.  If you need to use auth, look at the -y or -k flag.  If your domain's SOA isn't quite aiming your client at the right server, the "server" command lets you specify where to send updates.  If your AD admins aren't as accommodating as mine, try buying them a beer.

No comments:

Post a Comment