Question C:\\Windows\System32\drivers\etc\hosts: Not Functioning, Being Ignored

I have a new installation of a Windows 10 pro install, fully updated (given to me by a friend who is closing down some of his shop inventory he doesn't use). It works quite well, except I am trying to add some aliases for local network devices. The file in the title is not corrupt, and it has correct permissions. I can ping the dotted-decimal address I've added to a NAS there, but I wanted to simply refer to it as "nas" sometimes instead of memorizing the IP address. Can't do it. I've even gone so far as to load the file in an editor which shows hidden characters, e.g., tabs, newline, carriage return, so on. The file has been restored and reedited with different editors (run as administrator). The regular user can read that file. The same edits work on other Windows 10 machines, and I have many times rebooted and flushed DNS cache.

If the file is not corrupt, and if permissions are correct, and if syntax is correct, and if DNS cache is not the problem, then what setting would need to change to enable the "C:\\Windows\System32\drivers\etc\hosts" file?
 
No, it is definitely at the full path listed, not SystemWOW64. I was not even aware of SystemWOW64. Is there some secondary location the file needs to be other than:
C:\\Windows\System32\drivers\etc\hosts
typo in path? extra \ character in path.
should be
c:\windows\system32\drivers\etc\hosts

note: old bug in cmd.exe strips out leading \ characters.

ie c:\\\\windows\system32\drivers\etc\hosts
is the same. but some of these old bugs might be turned off because of a optional flag setting in new versions of windows.
 
typo in path? extra \ character in path.
should be
c:\windows\system32\drivers\etc\hosts

note: old bug in cmd.exe strips out leading \ characters.

ie c:\\\\windows\system32\drivers\etc\hosts
is the same. but some of these old bugs might be turned off because of a optional flag setting in new versions of windows.
No, the path is correct. Also, I didn't manually type it in to edit the file, that's just how it shows up. "C:\" is the "C" drive; the root of the path starts with "\", and naming the drive plus the start of an absolute path is "C:\\".

Browsers substitute a forward slash, but put this in your browser to try it out:
file://c:\

You will find the browser translates it to "http" URL syntax, but this is the root of the C drive.

Regardless, my editor opened this file from Windows file explorer, and the comments which are at the top of the default file were in fact there. No mistake. I just do not know why edits are ignored. Some bug no doubt, but I have no idea what it would be. I've probably edited this on a dozen windows 10 systems and none have ever been ignored (until now).
 
That's absolutely weird.

Try HostsMan ?


You can also setup a local DNS like Technitium DNS
I tend to not trust third party apps. Even so, I really want to know what is wrong with this hosts file rather than finding a workaround. I've never had a hosts file do this before and I've been using that for a very very long time.
 
If you can't solve hosts file issue, I don't know how you can solve naming issue without using a DNS server.

What's your NAS brand/model and can it run a DNS service, server, docker or VM?
 
Last edited:
If you can't solve hosts file issue, I don't know how you can solve naming issue without using a DNS server.

What's your NAS brand/model and can it run a DNS service, server, docker or VM?
It isn't that I can't ping or reach the NAS. I can do with the dotted decimal address. Also the printer and three other computers on the network via dotted decimal. Google, a lot of others by name work perfectly.
 
I didn't say your DNS setting is not working. However the DNS server most uses use are public DNS severs that only resolve computer names on the internet, not LAN devices/computers.

If your hosts file doesn't work, you need a local DNS to work for you.
 
I didn't say your DNS setting is not working. However the DNS server most uses use are public DNS severs that only resolve computer names on the internet, not LAN devices/computers.

If your hosts file doesn't work, you need a local DNS to work for you.
This is what the hosts file is for. Local aliases without the overhead of a custom DNS setup. There is no need for local DNS if I can give an alias to dotted=decimal addresses. It is the very purpose of the hosts file.
 
Of course I know what hosts file is and it's purpose and if it works then you don't need a burden of a DNS,

You also think your hosts file path is absolutely correct with double back slash.

Hope other members can help.
 
I am not sure that I completely understand the requirement.

FYI:

https://serverfault.com/questions/377623/how-to-set-local-alias-for-a-machine

Note the mention of CNAME.

However, aliases can be created.

https://learn.microsoft.com/en-us/w.../create-an-alias-cname-record-in-dns-for-web1

From the link:

"You can use this procedure to add an Alias canonical name (CNAME) resource record for your Web server to a zone in DNS on your domain controller. With CNAME records, you can use more than one name to point to a single host, making it easy to do such things as host both a File Transfer Protocol (FTP) server and a Web server on the same computer."

That said, if aliases are required then Powershell can do such things.

Not something that I have worked with (full disclosure). However, the following links may prove helpful.

https://techcommunity.microsoft.com...-aliases-in-place-of-dns-cname-records/259064

https://www.commandinline.com/cheat-sheet/resolve-dnsname/

That all said, I next stumbled on to this old link:

https://superuser.com/questions/319566/how-do-i-alias-a-hostname-in-windows

From the link:

"HOSTS is only for giving names to IP addresses. So you can so something like:

10.1.1.2 Computer.domain.com Alias1 Alias99


Instead of 10.1.1.2 you would use the NAS Static IP address.
 
@Ralston18

What you mentioned in the beginning was a in business environment where there is a Windows server domain controller running Active Directory and of course the DNS that comes along with it. It's even more complex,