summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-08-22 17:41:08 +1000
committerAndrew Tridgell <tridge@samba.org>2011-08-25 07:39:38 +1000
commit717706cb9691d435071c9883b3da649fcada2ea6 (patch)
treec35d2b30958bff0090ccafc3f3f6748c6ed8ac00
parent219271bd154817ccf0cb4706769e07eb5dfa11ee (diff)
downloadsamba-717706cb9691d435071c9883b3da649fcada2ea6.tar.gz
s4-dns/spn: fixed DNS and SPN scripts to setup forest DNS name
-rwxr-xr-xsource4/scripting/bin/samba_dnsupdate6
-rwxr-xr-xsource4/scripting/bin/samba_spnupdate5
2 files changed, 6 insertions, 5 deletions
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 9f370348279..9609fe992bc 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -225,9 +225,9 @@ def get_subst_vars():
samdb = SamDB(url=lp.samdb_url(), session_info=system_session(),
lp=lp)
- vars['DNSDOMAIN'] = lp.get('realm').lower()
- vars['DNSFOREST'] = lp.get('realm').lower()
- vars['HOSTNAME'] = lp.get('netbios name').lower() + "." + vars['DNSDOMAIN']
+ vars['DNSDOMAIN'] = samdb.domain_dns_name()
+ vars['DNSFOREST'] = samdb.forest_dns_name()
+ vars['HOSTNAME'] = samdb.host_dns_name()
vars['NTDSGUID'] = samdb.get_ntds_GUID()
vars['SITE'] = samdb.server_site_name()
res = samdb.search(base=samdb.get_default_basedn(), scope=SCOPE_BASE, attrs=["objectGUID"])
diff --git a/source4/scripting/bin/samba_spnupdate b/source4/scripting/bin/samba_spnupdate
index d99461a9fc3..10da1d917b6 100755
--- a/source4/scripting/bin/samba_spnupdate
+++ b/source4/scripting/bin/samba_spnupdate
@@ -70,8 +70,9 @@ def get_subst_vars(samdb):
global lp
vars = {}
- vars['DNSDOMAIN'] = lp.get('realm').lower()
- vars['HOSTNAME'] = lp.get('netbios name').lower() + "." + vars['DNSDOMAIN']
+ vars['DNSDOMAIN'] = samdb.domain_dns_name()
+ vars['DNSFOREST'] = samdb.forest_dns_name()
+ vars['HOSTNAME'] = samdb.host_dns_name()
vars['NETBIOSNAME'] = lp.get('netbios name').upper()
vars['WORKGROUP'] = lp.get('workgroup')
vars['NTDSGUID'] = samdb.get_ntds_GUID()