System Administration

Re: Can I set up machine where the name lookup fails.

 
SOLVED
Go to solution
prateek_1
Advisor

Can I set up machine where the name lookup fails.

hi,

I need to make name lookup(hostname) fail and i can ping the machine in network only by it's IP address.
15 REPLIES 15
Court Campbell
Honored Contributor

Re: Can I set up machine where the name lookup fails.

don't add dns to the hosts line in /etc/nsswitch.conf.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
prasadb
Super Advisor

Re: Can I set up machine where the name lookup fails.

Also, comment the DNS server entries in /etc/resolv.conf
OldSchool
Honored Contributor

Re: Can I set up machine where the name lookup fails.

If OTHER machines are to access this server by IP only, then don't add entries for the server in question to your DNS server.

If you do, then the name will resolve on other machines that use the DNS database.
prateek_1
Advisor

Re: Can I set up machine where the name lookup fails.

/etc/nsswitch.conf file is not present in /etc dir. here i can only see /etc/nsswitch.compat
file
prasadb
Super Advisor

Re: Can I set up machine where the name lookup fails.

can you see /etc/resolv.conf file there..

give here

#cat /etc/resolv.conf

you must have entry of the DNS servers in this file , then comment the entries
prateek_1
Advisor

Re: Can I set up machine where the name lookup fails.

I commented out each entry in /etc/resolv.conf file ,but i can still able to ping m\c by its hostname.

Re: Can I set up machine where the name lookup fails.

You'll also need to comment out relevant entries in /etc/hosts file.

Duncan

I am an HPE Employee
Accept or Kudo
prateek_1
Advisor

Re: Can I set up machine where the name lookup fails.

I am allready comment out relevant entries in /etc/hosts file.but it still give hostname by hostname command actually i dont need it.
Ivan Krastev
Honored Contributor
Solution

Re: Can I set up machine where the name lookup fails.

Are you pinging the server from other machine ? Change DNS record if yes.

regards,
ivan