So is acer the DNS server? That's what resolv.conf is configured as.
Your ping failure indicates that either there's no route to the DNS server (192.168.5.1), the DNS service is not running on that server, or the DNS service does not know about acer.
What happens if you
#ping 192.168.5.1
from RHEL?
Your entry in /etc/hosts on RHEL for acer should allow it to resolve the name acer within the RHEL OS without reference to the DNS server.
[root@rhel7 ~]# ping 192.168.5.1
PING 192.168.5.1 (192.168.5.1) 56(84) bytes of data.
64 bytes from 192.168.5.1: icmp_seq=1 ttl=64 time=0.588 ms
64 bytes from 192.168.5.1: icmp_seq=2 ttl=64 time=0.566 ms
64 bytes from 192.168.5.1: icmp_seq=3 ttl=64 time=0.829 ms
^C
--- 192.168.5.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.566/0.661/0.829/0.119 ms
[root@rhel7 ~]#
The host PC ( windows - acer ) where VM is installed maintains the list of hostname and ips in its host file. As such it is not a "so called DNS server", but since it maintains the list in host file and 192.168.5.1 is specified as name server then my understanding is that it should search in the host file of acer ( 192.168.5.1)
As per your recommendation I have added acer in the host file of RHEL.
RHEL host file now looks like.
I think somehow rhel is not able to contact acer when name resolution is required.
Some how rhel is not able to findout which is the name server ?
Do you have any clue what can be the reason ?
I entered acer ( ip and hostname ) in host file of rhel.
As I mentioned, acer maintains list of host name entry in the host file.
acer is a vmware windows host whereas rhel is installed as a vitual machine in vmware
Remember that ping often uses gethostbyname system/kernel call where traceroute often uses the actual DNS lookup. You can also easily test whether the entries are indeed in DNS by using nslookup or dig
I believe that 192.168.5.1 is your Acer windows PC, and there is no DNS server on it, which are you relies to.
You'll need to set some other DNS server for your Linux server in resolf.conf, for example 8.8.8.8 (Google DNS server).
If you need to be able ping your Acer PC by name from Linux server, you can add this line at /etc/hosts:
192.168.5.1 acer
I think that you might need to improve your knowledge about DNS a little, this article can help a bit.