Skip to content

Instantly share code, notes, and snippets.

@zerwes
Last active February 19, 2022 18:06
Show Gist options
  • Save zerwes/98418eb4a194bd54a42670a8a3560444 to your computer and use it in GitHub Desktop.
Save zerwes/98418eb4a194bd54a42670a8a3560444 to your computer and use it in GitHub Desktop.
rename the single DC in a samba domain

rename the single DC in a samba domain

samba backup and restore with new DC name

# service samba-ad-dc stop
# mkdir sambabackup-20220213-offline
# samba-tool domain backup offline --targetdir=/root/sambabackup-20220213-offline
# mv /var/lib/samba /var/lib/samba.bakup
# samba-tool domain backup restore --newservername=DC01 --backup-file=/root/sambabackup-20220213-offline/samba-backup-2022-02-13T19-38-42.702607.tar.bz2 --targetdir=/var/lib/samba
# vim /etc/samba/smb.conf # set new "netbios name"
# service samba-ad-dc start
# samba_dnsupdate

TL;DR: https://wiki.samba.org/index.php/Back_up_and_Restoring_a_Samba_AD_DC

bind-dlz

If you use bind-dlz this needs to be re-setup

# samba_upgradedns --dns-backend=BIND9_DLZ
# service named restart

TL;DR: https://wiki.samba.org/index.php/Dns_tkey_negotiategss:_TKEY_is_unacceptable

check DNS

# dig +noall +short @localhost _ldap._tcp.$(hostname -d) SRV
# dig +noall +short @localhost _kerberos._udp.$(hostname -d) SRV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment