Why doesn't hostname -f show FQDN?

My 2 PR4100 and 2 EX4 do this and it is bugging me.
I am also wondering if it’s the root cause of my AD issues with users mapping shares or is it just wrong.

In the “Settings” > “General” > “Device Profile” > “Device Name” is “WD-PR4100-02”
Logging in as sshd through PuTTY.

root@WD-PR4100-02 ~ # hostname
WD-PR4100-02
root@WD-PR4100-02 ~ # hostname -i
192.168.123.12
root@WD-PR4100-02 ~ # hostname -f
WD-PR4100-02 ← This should be the FQDN

root@WD-PR4100-02 ~ # nslookup WD-PR4100-02
Server: 192.168.123.15
Address: 192.168.123.15:53

Name: WD-PR4100-02.b-domain-us.org
Address: 192.168.123.12
root@WD-PR4100-02 ~ # nslookup 192.168.123.12
Server: 192.168.123.15
Address: 192.168.123.15:53

12.123.168.192.in-addr.arpa name = wd-pr4100-02.b-domain-us.org

Cat the /etc/hosts file:
127.0.0.1 localhost localhost.localdomain
192.168.123.12 WD-PR4100-02 WD-PR4100-02
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Question:
Should the “Setup” “Device Name” be “WD-PR4100-02.b-domain-us.org”?

Hi @delldsb
Have you opened a Support Case? If not opened, for more information, please contact the WD Technical Support team for the best assistance and troubleshooting:

Update:
Changing the entry for “hosts” in the /etc/nsswitch.conf file “solved” the issue.
The line looks like this as the default:
root@WD-PR4100-02 ~ # cat /etc/nsswitch.conf


hosts: files dns

Basically, with the “files” option being first on the list will cause many system commands to use the /etc/hosts file first to resolve the hostname.
The problem is that the FQDN is not in the PR4100’s hosts file and the ‘hostname -f’ will return the wrong data (the simple hostname).

I edited the /etc/nsswitch.conf file to swap the entries:
hosts: dns files

This “solved” the lookup for the ‘hostname -f’ command and returned the true FQDN.
If DNS is offline or unreachable, the commend will time-out and use the file (/etc/hosts).

I don’t know if this helped with any other issues, but at least it is correct now.
I know there are some files that are not persistent. They get replaced by the OS back to the “original” files that are stored someplace on the PR4100 (I think /etc/hosts was one). But I’ll keep an eye on the this to see if the /etc/nsswitch.conf is one that gets rewritten.