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 at  Here's how I use nsupdate interactively, one command at a time, in a terminal, to restore reality:
  > update delete A
  > send
  > update delete PTR
  > send
  > update add 86400 IN A
  > send
  > update add 86400 IN PTR
  > 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