The problem lies in name resolution (translating names to IPs and vice versa). Depending how big your home network is you can choose two solutions:
1) Hosts : Edit %systemroot%\system32\drivers\etc\hosts
file on each windows machine. It is likely in C:\windows\system32\drivers\etc\
for a standard windows installation. You may need to open notepad as Administrator for this (i.e. right click Notepad, choose run as
). All lines containing hosts should start without whitespace at the beginning. Comment lines start with #. Comments can also be appended at the end of the line provided there is at least one whitespace between the last name and the comment. Host lines should start with IP address then one or more names that you will be using for that particular host. Whitespaces (or tabs) serve as separators.
Example:
127.0.0.1 localhost
192.168.0.1 pc1.local.domain pc1
192.168.0.2 pc2.local.domain pc2
192.168.0.3 pc3.local.domain pc3
192.168.0.4 pc9.local.domain pc9 # name has no correspondence to IP address ;)
192.168.0.7 pc7.local.domain
# either 1 or 254 usually serves as the gateway so:
192.168.0.254 gw.local.domain gw
# and certainly you don't have to use FQDN for your LAN so:
192.168.0.7 pc8 # is good too, just like localhost entry
Note: no correspondence between last part of IP address and the name itself. Common sense says if you give more than one name (synonyms) - the short name should correspond to the host part (i.e. the word before the first dot in the name) of the long machine name (so called FQDN). Short name is great for pinging, opening shares, etc. Theoretically you could give several synonyms, practically I don't know why this would be necessary in a small home network. See this TechNet article for further information.
Obviously the downside is - you need to keep hosts file the same on all of your computers.
As to your router - it is likely just a forwarder for your ISP (or google DNS server), so I do not think you can configure that one to resolve names for your internal LAN. Even if you succeed to hack it spending time and effort, after the next firmware update you may need to do that again. But if you have a router which provides to set up LAN DNS - please do let me know what make it is :)
2) DNS : install configure and run your own DNS server. There are several available. Depends not so much on the size of your nework, but rather on whether you want to delve into configuration of zones, etc. I did it a couple of months ago for my home network consisting of just 5 machines (including router) - but I did so that I can run SAMBA4 AD server.
when you say network name, do you mean DNS, Windows host name, or both? do you have a windows domain? what is your DNS server setting for the effected box, and do you have more than one subnet? usually unless you are using a MS domain, name resolution on dynamically addressed machines can be problematic. it is better to statically address your network if you wish to use names, but don't plan to use any advanced naming technology like dynamic name registration. – Frank Thomas – 2013-12-12T16:53:47.607
What's the exact command you are trying to run? Are you including domain information in the "name"? What are you using for a DNS server on the client(s)? When you do an
NSLookup <computername>
what IP is returned for the host you looked up? What IP is returned for the DNS server NSLookup says it's using? – Ƭᴇcʜιᴇ007 – 2013-12-12T16:53:50.150Thanks guys! I have a very simple setup: a group of win7 machines and a router connected to a switch. There is no windows domain just a workgroup. What I am trying to accomplish is to determine the ip address of a machine on the lan by use of the computer name (i used the wrong wording in the title). The dns server is set by the dhcp host which is the router. – ElvisDumbledore – 2013-12-12T17:01:21.563
The machine's IP address is obtained either via DHCP or you type it in manually as in your case. Windows networking (i.e. shares via SMB protocol also known as CIFS) likely resolves the computer name from your local network share advertisements (NetBIOS share names) - hence you can do lookups (access shares) with your windows explorer. Programs relying just on standard internet TCP/IP mechanisms such as ping don't do that. For them it is necessary to have some internet standard name resolution - such as through hosts file or DNS. – r0berts – 2013-12-12T17:36:52.013