LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to ping server ip from client system (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-ping-server-ip-from-client-system-4175544567/)

hruday 06-05-2015 05:15 AM

unable to ping server ip from client system
 
i have centOS server 5.8 with ip address 192.168.1.105.
now task is if i do "ping test.xyz.com" from any other system in LAN then it should reply from 192.168.1.105. how to do it.?

wpeckham 06-05-2015 05:42 AM

Things to consider
 
research "name resolution", bind, hosts file, and possibly arp for interesting and pertinent information.

Easy answer: put that host into your local DNS. Easier answer that does not scale well: if you do not run a DNS, put it into the hosts table (/etc/host) on every client machine.

ferrari 06-05-2015 05:46 AM

In general, you'd need to have a DNS server running, but a minimal approach that may work for you is to just add the hostname mapping to the /etc/hosts file. Another option (if you don't want the hassle of administering a DNS server), is to consider using Avahi. This is described well here:

https://wiki.archlinux.org/index.php/Avahi

FWIW, my home DSL router happens to provide this service, making it a trivial exercise to reach machines by hostname.

hruday 06-05-2015 06:07 AM

@ferrari and @wpeckahm will u please help me out with commands. Thanks

ferrari 06-05-2015 06:34 AM

I would have expected you would have told us if you had a DNS running. So, assuming a small LAN with one server that you need to reach by hostname the easiest solution is to edit /etc/hosts on the client machine(s) with an entry similar to

Code:

192.168.1.105  test.xyz.com  test
For more info
Code:

man /etc/hosts


All times are GMT -5. The time now is 02:46 AM.