Hostname resolution from one linux host to another linux hos

Taking care of your Linux box.
Post Reply
mashkoor.qadir
Lance Naik
Posts: 32
Joined: Mon Dec 20, 2010 10:27 pm
Location: Karachi
Contact:

Hostname resolution from one linux host to another linux hos

Post by mashkoor.qadir » Tue Oct 27, 2015 1:09 pm

Dear all,

I am using windows DNS server in my environment.

All windows clients can ping all linux and windows machines. but I can't ping from one Linux host to another Linux. Ping response is unknown host. However it is working fine with FQDN(eg: host1.linux.example.com).

I need to resolve only with hostname (eg host1.linux).

How to get it resolve.

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Re: Hostname resolution from one linux host to another linux

Post by lambda » Tue Nov 10, 2015 7:36 pm

add the search or domain field to your /etc/resolv.conf files. for example

Code: Select all

nameserver 192.168.1.1
domain mycompany.com
or

Code: Select all

nameserver 192.168.1.1
search mysubdomain.mycompany.com mycompany.com
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

mashkoor.qadir
Lance Naik
Posts: 32
Joined: Mon Dec 20, 2010 10:27 pm
Location: Karachi
Contact:

Re: Hostname resolution from one linux host to another linux

Post by mashkoor.qadir » Fri Nov 27, 2015 4:24 pm

Thanks Lambda,

Adding search option in /etc/resolv.conf file fixed my issue.

Post Reply