Hostname not resolving to local IP address

2020-04-16 04:06发布

I am running a Windows 8 VM inside of vmware Fusion. It runs inside a Mac running OSX 10.10 (Yosemite). The VM has a computer name of "Proud". When I ping the VM from within itself, i.e. ping -a 192.168.0.138 I get a response like:

Pinging Proud [192.168.0.138] with 32 bytes of data: Reply from 192.168.0.138: bytes=32 time<1ms TTL=128

However whenever I ping Proud from Yosemite, i.e. ping Proud I get a response like:

PING proud (199.101.28.130): 56 data bytes 64 bytes from 199.101.28.130: icmp_seq=0 ttl=46 time=418.646 ms

The VM is using bridged networking.

Why does Proud resolve to that IP address? It is not correct and means I am unable to use the hostname (a necessity) so that I can connect to it from the Mac.

4条回答
\"骚年 ilove
2楼-- · 2020-04-16 04:39

You need to check on your own /etc/host file. See if you might have done any changes to this file, to indicate the machine "Proud" comes as 192.168.0.138 or x.x.x.130? Next thing to ensure (user3666197 is actually right), you need to check on ifconfig to check if you have any connection have the IP address pointing to x.x.x.130 or x.x.x.138.

Last but not least, is there any virtual appliance or instance running of "proud" which might have caused confusion as it is possible for any virtual appliance or instance to get a IP address from the same segment as well, hence having "two" machines on the network?

Hope this helps. Check on your WINS config too...

查看更多
smile是对你的礼貌
3楼-- · 2020-04-16 04:47

First, test and check with IP_address typed for ping from OSX 10.10 <host> terminal, so as to be independent of any DNS-service, that is responsible for a hostname translation of your <hostname> to a pre-configured IP_adress

Second, You say bridged -- thus check, that the VM has the very same network-part of the IP_address ( boundary is given by non-zero bits in subnet-mask

Check details with ifconfig resp. ipconfig

-------------------------|-----------------------------|||--------|||.|||.|||.|||
VM/w8  connected to VMnet? has IP_address := 192.168.0.??? subnet ???.???.???.???
RM/OSX connected to VMnet? has IP_address := 192.168.0.??? subnet ???.???.???.???

EDIT#12014-08-20 15:30 [UTC+0000]:

-------------------------?-----------------------------???--------255.255.255.0
-------------------------|-----------------------------|||

Best to post PrintScreens from {OSX|w8} terminals {ping|ipconfig|ifconfig} and the setup of VMnet

查看更多
Emotional °昔
4楼-- · 2020-04-16 04:56

This seems to be a 'feature' of Mac OS. If I attempt to ping any hostname it will return the ping from this IP address - even if the hostname is fictional. I do not know why OS X does this.

查看更多
▲ chillily
5楼-- · 2020-04-16 05:03

This is called DNS hijacking and is done by a lot of ISPs out there to redirect you on incomplete or wrong browser address inputs and show you these custom pages with advertisment 'Hey, we couldn't find your webpage Aple.com but maybe you look for Apple.com?'

Maybe this is whats happening here. Btw, ISPs break RFCs here.

查看更多
登录 后发表回答