Trouble resolving FQDN

I have a Samba4 AD/DC that is also the domain DNS server. Its IP address is 192.168.0.2 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
Server:         127.0.1.1
Address:        127.0.1.1#53

Name:   mail.hprs.local
Address: 192.168.0.2

$nslookup 192.168.0.2
Server:         127.0.1.1
Address:        127.0.1.1#53

2.0.168.192.in-addr.arpa        name = mail.hprs.local.

$ host mail
mail.hprs.local has address 192.168.0.2

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

~$ ping mail
PING mail.hprs.local (192.168.0.2) 56(84) bytes of data.
64 bytes from mail.hprs.local (192.168.0.2): icmp_seq=1 ttl=64 time=0.240 ms
64 bytes from mail.hprs.local (192.168.0.2): 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.
LVL 1
jmarkfoleyAsked:
Who is Participating?
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
0
Dan McFaddenSystems EngineerCommented:
This has been discussed here before:

link:  http://www.experts-exchange.com/Networking/Protocols/DNS/Q_27106598.html

Dan
0

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.
0
ON-DEMAND: 10 Easy Ways to Lose a Password

Learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees in this on-demand webinar. We cover the importance of multi-factor authentication and how these solutions can better protect your business!

jmarkfoleyAuthor 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
127.0.0.1       localhost
127.0.1.1       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)
      DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
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 127.0.1.1 (which is the local host uCommon in /etc/hosts) and not 192.168.0.2 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
0
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)
0
jmarkfoleyAuthor Commented:
Solved!
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

to

host:          files dns

That did the trick.
0
jmarkfoleyAuthor Commented:
Jeremy Weisinger, thanks for participating!
0
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Glad to. I always like learning. :)
0
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
DNS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.