Trouble resolving FQDN

I have a Samba4 AD/DC that is also the domain DNS server. Its IP address is and its FQDN is mail.hprs.local. From another linux host on the LAN (not joined to the domain) I can do:

$ nslookup mail.hprs.local

Name:   mail.hprs.local

Address:        name = mail.hprs.local.

$ host mail
mail.hprs.local has address

$ host mail.hprs.local
mail.hprs.local has address

~$ ping mail
PING mail.hprs.local ( 56(84) bytes of data.
64 bytes from mail.hprs.local ( icmp_seq=1 ttl=64 time=0.240 ms
64 bytes from mail.hprs.local ( icmp_seq=2 ttl=64 time=0.308 ms

but I cannot do:

$ ping mail.hprs.local
ping: unknown host mail.hprs.local

Any idea why I can't ping the FQDN? Also, I can `ssh mail`, but cannot `ssh mail.hprs.local`.

Note that this particular host is Ubuntu. I have another Linux host on the LAN that *can* ping mail.hprs.local and can ssh mail.hprs.local.

I don't get it. Not sure where to start looking.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan McFaddenSystems EngineerCommented:
Can you post the contents of the following files:

1. /etc/resolv.conf
2. /etc/nsswitch.conf
3. /etc/host.conf

Dan McFaddenSystems EngineerCommented:
This has been discussed here before:



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Can you try the following:

$ ping mail.hprs.local.

Notice the trailing dot.

Same thing for SSH

`ssh mail.hprs.local.`

If that works then it probably means the DNS suffix is being applied always. I'm not a Linux guy so I don't know how to fix.
Virus Depot: Cyber Crime Becomes Big Business

The rising threat of malware-as-a-service is not one to be overlooked. Malware-as-a-service is growing and easily purchased from a full-service cyber-criminal store in a “Virus Depot” fashion. View our webinar recording to learn how to best defend against these attacks!

MarkAuthor Commented:
Config files on Ubuntu host (uCommon) - note that I have changed/set nothing in these file. They are per-installation (except I did add winbind to passwd and group in nsswitch.conf):

$ cat /etc/hosts       localhost       uCommon

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
search hprs.local

$ cat /etc/winbind.conf
passwd:         compat winbind
group:          compat winbind
shadow:         compat
hosts:          files mdns4_minimal [NOTFOUND=return] dns
networks:       files
protocols:      db files
services:       db files
ethers:         db files
rpc:            db files
netgroup:       nis

Some things look odd to me here. Why is the nameserver (which is the local host uCommon in /etc/hosts) and not which is the actual domain nameserver and also the DHCP server? That looks messed up to me, but I'm pretty new at Ubuntu.

Dan McFadden - I'll check out your link.

Jeremy Weisinger:
Can you try the following:
$ ping mail.hprs.local.
Notice the trailing dot.
No trailing dots. Just "ping unknown host mail.hprs.local". ssh gives:

$ ssh mfoley@mail.hprs.local
ssh: Could not resolve hostname mail.hprs.local: Name or service not known
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Judging from your config files, you need to set your nameserver to the correct entry.

Also, I wasn't saying that there were trailing dots, I was saying to add the trailing dots. All FQDNs have a trailing dot. It's just that most applications will append it for you. (you can try this in pretty much any application and see for yourself)
MarkAuthor Commented:
Dan McFadden, that link provided the answer. Apparently, when using domains with ".local" as the TLD, it uses "Multicast DNS" to do the lookup, which fails. The solution was to change the hosts line in /etc/nsswitch.conf from

hosts:          files mdns4_minimal [NOTFOUND=return] dns


host:          files dns

That did the trick.
MarkAuthor Commented:
Jeremy Weisinger, thanks for participating!
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Glad to. I always like learning. :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.