0

I set up PC with 2 network cards, connected to the same LAN. I can connect to this PC (e.g. by remote desktop) only via IP addresses. Accessing by hostname does not work.

Why is this the case?

UPDATE: Full environment

  1. PC with 2 hardware network adapters.
  2. On this PC installed VMWare Workstation. Created 3 VM's, networked by "bridged" network setting in VMWare.
  3. In LAN all IP addresses given from DHCP.
  4. Win2k8 on all hosts (both physical and virtual).
    As result:
  5. PC has 2 IP addresses (e.g. 192.168.1.71 and 192.168.1.72). PC available in LAN by IP addresses, but not available by hostname.
  6. VM's has own IP address on each (e.g. 192.168.1.73, *74, *75 etc). They are available from LAN by their ip's, BUT not by their hostnames.

How can I access to PC and to VM's by hostname?

12
  • 1
    are they on the same domain or workgroup? Commented Nov 27, 2011 at 1:18
  • Describing a problem just by saying it doesn't work isn't helpful. Commented Nov 27, 2011 at 1:24
  • Daniel - yes, all computers in same workgroup.
    – lewis
    Commented Nov 27, 2011 at 1:27
  • what about any firewalls? Commented Nov 27, 2011 at 1:33
  • Firewalls are enabled. But what difference on fw, if host is accessible via IP-address?
    – lewis
    Commented Nov 27, 2011 at 1:38

2 Answers 2

1

The easiest thing would just be to add the entries in your hosts file.

Open, using administrator privileges - your C:\Windows\System32\drivers\etc\hosts.

This file should already contain a couple lines like:

::1 localhost
127.0.0.1 localhost

Then just add relevant entries:

192.168.0.1 myawesomerouter
192.168.0.10 somethingelse
192.168.0.100 ahundred.domain.org
192.168.2.40 mygooglecopy.google.com

You can also use this to "blackhole" some sites, for example if you never wanted to communicate with www.google.com you could add the line:

127.0.0.1 www.google.com
5
  • How do you add entries to the hosts file? Could you edit your answer to reflect this? Commented Nov 27, 2011 at 16:25
  • @caimz, I don't want to use this solution, because it need to update hosts on each computer in LAN. IMHO, it is not good solution.
    – lewis
    Commented Nov 27, 2011 at 17:10
  • Well it was just a suggestion, since somehow your netbios doesn't seem to be in order to do proper name resolution. Does this apply to all VMs and the host? Also, what kind of router/thingie do you have in front?
    – cairnz
    Commented Nov 27, 2011 at 18:42
  • @cairnz Yes, this trouble applies to all VM's and host. LAN is connected to ADSL-modem with DHCP server inside it.
    – lewis
    Commented Nov 27, 2011 at 19:21
  • @cairnz, LAN is work.
    – lewis
    Commented Nov 27, 2011 at 19:31
0

Hostname resolution is typically handled by your router. Your IP configuration probably has your router's IP address as the DNS server. If that's the case, then the router will resolve the hostname to the local IP address. If you have your system set to use alternate DNS servers, like Google's 8.8.8.8, then hostname resolution may fail.

1
  • Yes, all my hosts (physical and VM's) obtained ip-addresses from DHCP. DHCP server works on adsl-modem.
    – lewis
    Commented Nov 27, 2011 at 19:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .