|
|
Updating your hosts file in Vista 64-bit |
| by Neil Middleton 11:37 am Monday, 3 November 2008. |
I came across an interesting issue this morning whereby my hosts file had simply vanished. For the unitiated amongst you, this file presents a kind of local DNS for Windows TCP/IP which essentially means you can make up a domain and point it at an IP address and have that apply to your machine only.
Now, normally this file is located in %systemroot%\system32\drivers\etc where %systemroot% is C:\Windows. However, on 64-bit, System32 is replaced by SysWOW64. Not such a big issue, except when you go looking for your hosts file from inside a 32-bit application such as Flex Builder / Eclipse.
For some reason, in Vista 64-bit, 32-bit applications can’t see the 64-bit tree, meaning that the hosts file is essentially invisible. So, how the hell do we get round this?
Well, backdoor ahoy - there is a solution. In your C:\Windows folder (%systemroot%) create a “sysnative” folder and browse through that. Bingo! your good old 32-bit folder structure should now be present, and low and behold your hosts file.
RSS feed for comments on this post. TrackBack URL
This is great information. Thank you.
Comment by Fabio — Monday, 8 December 2008 @ 10:47 pm
Can you elaborate on that a bit more? What do you mean by “browse through that” for the %systemroot%\sysnative folder? Do I add that to the path in my shortcut for the hosts file somehow?
Comment by Bill — Friday, 19 December 2008 @ 5:35 am
Hi, I have Vista x64. I found the hosts file in my \system32\drivers\etc\ folder but can’t seem to be able to edit it despite having administrator rights. I’ve checked the permissions on it and I should have full control over it but Windows refuses to let me edit it.
I then tried your alternative method and created the sysnative folder but this did nothing other than create a normal subfolder. There is nothing in it. Am I missing something here?
Comment by Raj Parmar — Thursday, 25 December 2008 @ 5:17 am
Raj you have to right click “run as Admin” on notepad before you can edit the hosts file.
Comment by tony — Sunday, 18 January 2009 @ 8:00 pm
To edit the Hosts file in vista x64:
Start, type Notepad in search box. right click on notepad.exe, run as administrator.
then from in notepad, browse to the system32\drivers\etc and open hosts.
Comment by Gary Black — Saturday, 24 January 2009 @ 5:23 am
Dude - where did you ever dig up this “sysnative” bit?? Very nice find, man!
I’ve soooo been needing to edit my hosts file because of some very annoying dns/vpn miscommunications… THANKS!!!
Comment by cdolson — Thursday, 12 February 2009 @ 7:40 am
QUOTE: “Can you elaborate on that a bit more? What do you mean by “browse through that” for the %systemroot%\sysnative folder? Do I add that to the path in my shortcut for the hosts file somehow?”
ANSWER:
OK, I was having this same question and came up with the following. Basically, just follow the instructions as described above (i.e., go to COMPUTER –> C: –> WINDOWS –> then create a new folder called “sysnative”).
OK, now try out the following:
(1) Open up a 32-bit application (and this is absolutely KEY) such as Notepad++ (if you don’t have it, download it sourceforge.net). FYI, you can confirm that you are using a 32-bit application by opening up your task manager (Ctrl + Alt + Delete…and so forth) and then in the PROCESSES tab just look for the application name with an “*32″ next to it…if it does NOT have an *32 next to its name, then it is a 64-bit application).
(2) From your 32-bit application (e.g., Notepad++), browse to COMPUTER –> C: –> WINDOWS –> SYSTEM 32 –> DRIVERS. You’ll likely notice that from the DRIVERS folder you will NOT see the “etc” folder which usually contains the “hosts” file . . . correct?
(3) Now, to show how this SYSNATIVE folder trick works, go ahead and (still from your 32-bit application such as Notepad++) and browse to COMPUTER –> C: –> WINDOWS –> SYSNATIVE –> DRIVERS –> ETC. From this location you’ll now be able to see your “hosts” file…correct? If that worked, then you now can see what was trying to be explained in the original post.
What I’m guessing you did wrong was instead of browsing through the “SYSNATIVE” folder from INSIDE 32-bit application, you merely were using Windows Explorer to open the folder (fyi, Windows Explorer is a 64-bit application … NOT a 32-bit one; hence the reason why it didn’t work!).
(4) As an alternative to explain this, instead of using a 32-bit text editor like Notepad++, instead use a 64-bit text editor like notepad.exe which is located in COMPUTER –> C: –> WINDOWS –> SYSTEM 32. If you use this 64-bit editor and try to browse through your SYSNATIVE folder, then low and behold you’ll notice that the SYSNATIVE folder is empty!
Anyway, I hope that helps!
Comment by Markus Calus — Saturday, 7 March 2009 @ 10:21 pm
When I try to create the folder called “sysnative” inside my windows folder, it gives me an error that states “The file or folder does not exist” which is weird as i am not looking for it, i am trying to create it. Got any suggestions?
Comment by wykdfantasy — Friday, 13 March 2009 @ 8:32 pm
Sup, i did exactly like that, browsed to Windows/sysnative/drivers/etc with notepad++ but i STILL cannot see my hosts file :O
:S
Help would be appriciated.
Comment by pewpewqq — Saturday, 14 March 2009 @ 11:39 am
I have a ”lmhosts” file but not a ”hosts” file
Comment by pewpewqq — Saturday, 14 March 2009 @ 11:41 am
I tried this and it is working fine on my Vista 64. The entries in the host file are interpreted by all 32-Bit Browsers - but not by IE7, which is a 64-Bit application. Is IE7 using another host file?
Comment by Thomas — Tuesday, 17 March 2009 @ 3:09 pm
Guys! I had some problems with that, because even after created “sysnative” folder i did not see the etc folder with hosts file…
The very important thing here is to create a “Sysnative” not “sysnative” (notice the big “S”) folder - it makes a huge difference!
Adam
BTW: great tip! Helped me a lot!
Comment by silverweb — Saturday, 21 March 2009 @ 3:46 pm
Great Suggestion! I’ve replicated the post with step by step instructions on my blog as well… The key is to make the folder in explorer… and then open it from your editor. The folder itself won’t work in explorer, and you can’t create the folder from the app.
Comment by Justin Gehring — Saturday, 23 May 2009 @ 3:50 pm
[...] Thanks to Monochrome Blog Posted by Justin Gehring Filed in [...]
Pingback by Rinsefirst » Blog Archive » Can’t Find Hosts File? Here’s how in Windows Vista 64-bit. — Saturday, 23 May 2009 @ 3:51 pm
Thanks! Good piece of work which helps a lot. Cheers
Comment by Rafal Baumann — Tuesday, 9 June 2009 @ 6:47 pm
Thanks alot. Really appreciate that workaround.
Comment by Tm — Sunday, 14 June 2009 @ 9:39 pm
Great blog…This worked exactly as described. Very well explained! Thank you!!
Comment by MikeV — Thursday, 23 July 2009 @ 4:47 pm
Try to set attributes of the file if you still cant edit.
Sample solution:
http://www.emeksepeti.com/blog/post/2009/08/06/Changing-your-hosts-file-in-Vista.aspx
Comment by Ozan K. BAYRAM — Thursday, 6 August 2009 @ 1:14 pm
In reality, this is even easier:
You do *not* need to create the Windows\Sysnative diretory
It is already a special entry in Windows, you just need to tell your 32-bit apps to use it!
So, if you use your favorite 32-bit application (for me: cygwin or emacs)
you can just: ls C:/Windows/Sysnative/Drivers/etc/hosts
and there it is!
Comment by Jack Punt — Thursday, 13 August 2009 @ 12:56 am
thank you for your explanation
(1) Open up a 32-bit application (and this is absolutely KEY) such as Notepad++ (if you don’t have it, download it sourceforge.net). FYI, you can confirm that you are using a 32-bit application by opening up your task manager (Ctrl + Alt + Delete…and so forth) and then in the PROCESSES tab just look for the application name with an “*32″ next to it…if it does NOT have an *32 next to its name, then it is a 64-bit application).
…..
it worked for me.
Comment by Aki — Saturday, 15 August 2009 @ 7:41 pm
A huge THANK YOU! I was so frustrated in trying to find the file, let alone edit the blasted thing.
Neil’s blog got me started, and Markus’ post (number 7 on this blog) took me to success.
Thanks again,
OX
Comment by OX — Saturday, 22 August 2009 @ 9:31 pm