Skip to content

Instantly share code, notes, and snippets.

@genadipost
Last active January 7, 2024 21:22
Show Gist options
  • Save genadipost/2d5eb75e0a46ca4e5ac756d640b2da5a to your computer and use it in GitHub Desktop.
Save genadipost/2d5eb75e0a46ca4e5ac756d640b2da5a to your computer and use it in GitHub Desktop.
nsupdate with active directory (GSS-TSIG)

kinit with a domain user:

kinit genadi@TEST.LOCAL

Ones you have a krbtgt you can run nsupdate in GSS-TSIG mode:

nsupdate -g

Examples:

Create A record:

Interactive:

nsupdate -g
> zone test.local.
> update add comp1.test.local. 86400 A 192.168.227.100
> send

One liner:

echo -e "update add comp1.test.local 86400 A 192.168.227.100 \nsend" | nsupdate -g

Create PTR record

Interactive:

nsupdate -g
> zone 227.168.192.in-addr.arpa.
> add 100.227.168.192.in-addr.arpa. 86400 PTR comp1.test.local.
> send

One liner:

echo -e "zone 227.168.192.in-addr.arpa.\n add 100.227.168.192.in-addr.arpa. 86400 PTR comp1.test.local. \nsend" | nsupdate -g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment