Host Name Access in VMWare Fusion

I am using CentOS (Cloudera CDH3 image) as a guest OS running on my VMWare Fusion. Everything is working fine, and I can access the guest machine through my MAC OS using the IP address. I connect a network between my MAC machine and VMWARE, so the guest has a separate IP address and I can successfully use SSH using the IP address. The problem I am facing is that there is no way to access the guest OS by hostname. I tried to configure the host name on the guest OS, but the MAC cannot connect to the machine using the host name and does not even recognize the host name. I need this because I use a library that receives the host name of the remote computer as a parameter for the connection. Unfortunately, it does not accept IP, and so far I have not been able to get it to work. Any idea on how to solve this?

I even tried using NAT for VMWare, but CentOS does not connect to the Internet in this mode. I tried to change manually, but did not have time. here is a screenshot from the guest OS (CentOS):

enter image description here

+4
source share
1 answer

Either you get this IP address entered on your DNS servers, or do the following:

on your 'host' machine, edit `/etc/hosts` add this line: `<ip-address-of-your-VM> <hostname-you-wish-to-call>` 
+2
source

All Articles