1

I have joined an Ubuntu 14.04 machine to domain using samba 4 but auth is not working. Look what I get:

# net ads keytab create -U 'admin'
Enter admin's password:
ads_get_dnshostname: No dNSHostName attribute!
../source3/libads/kerberos_keytab.c:328: unable to determine machine account's dns name in AD! 

Testing if my FQDN is correct I get:

# hostname -d
dom.forest.int

# domainname
(none) 

Why does domainname has different behavior than hostname -d? Could this be the problem with Samba?

This is my configuration:

# grep MYPCNAME /etc/hosts
127.0.1.1       MYPCNAME.dom.forest.int MYPCNAME

and this:

# cat /etc/hostname
MYPCNAME

Is my configuration correct? How can I troubleshoot this further?

3 Answers3

0

You got different answer bacouse hostaname give you "name before domain". Command hostname -d give you domain aka DNS domain name.

Your full hostname you will got with command hostname -f

On some way can say hostname + hostname -d = hostname -f

2707974
  • 10,758
0

Use "dnsdomainname", not "domainname":

domainname - show or set system's NIS/YP domain name ... dnsdomainname - show the system's DNS domain name

Source: HOSTNAME(1) ("man domainname")

0

The manpage explains this quite clearly. Quoting from man hostname:

-d, --domain
                  Display  the  name  of the DNS domain. Don't use the command domainname to get the DNS domain name because it will show the NIS domain name and not the DNS domain name. Use dnsdomainname instead.

So domainname will show the NIS domain name, you need to use dnsdomainname instead.

muru
  • 207,228
heemayl
  • 93,925