name_to_fqdn() requires /etc/hosts to be set up in a special way to find
out the fqdn for dns updates. They are not set up by default and the
DNS update fails. Normally the fqdn is just <lp_netbios_name>.<realm>
and we should just use that. However if it is different, you can set
it to the special value in the smb.conf now.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
if (hostname) {
fstrcpy(machine_name, hostname);
} else {
- name_to_fqdn( machine_name, lp_netbios_name() );
+ const char *dns_hostname = lp_dns_hostname();
+ if (dns_hostname == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ fstrcpy(machine_name, lp_dns_hostname());
}
if (!strlower_m( machine_name )) {
return NT_STATUS_INVALID_PARAMETER;