Windows 7 hosts file
Thread Starter
Joined: May 2001
Posts: 10,804
Likes: 1
Windows 7 hosts file
Just tried to stick some entrys in my hosts file in windows 7 Home premium.
What a stupid pain in the backside system for editing system files.
I am logged in as admin can I edit them NO
I have to run as administrator notebook
Does this allow me to edit them NO
After 40 mins fiddling with the file permissions I eventually get to save the hosts file I want.
And thats another thing the hosts file in etc doesn't work
you have to go to
C
Windows\winsxs\amd64_microsoft-windows-w..nfrastructure-other_31bf3856ad364e35_6.1.7600.16385_none_6079f415110c0210
and modify the hosts file in that.
I had been quite happy with windows 7 but what a bloody PITA.
What a stupid pain in the backside system for editing system files.
I am logged in as admin can I edit them NO
I have to run as administrator notebook
Does this allow me to edit them NO
After 40 mins fiddling with the file permissions I eventually get to save the hosts file I want.
And thats another thing the hosts file in etc doesn't work
you have to go to
C
Windows\winsxs\amd64_microsoft-windows-w..nfrastructure-other_31bf3856ad364e35_6.1.7600.16385_none_6079f415110c0210and modify the hosts file in that.
I had been quite happy with windows 7 but what a bloody PITA.
Thread Starter
Joined: May 2001
Posts: 10,804
Likes: 1
Well I have found out that what I thought was an administrator account actually isn't!!!!
Logon to Windows 7 using your usual account.
Launch the cmd prompt - Make sure you select, 'Run as administrator'
Net user administrator p$ssw0rD
Net user administrator /active:yes
Switch User, or logoff
Logon as Administrator Password p$ssw0rD
(Your password may be different!)
Seems what you think is an admin account is really just a user account with sudo rights on certain commands.
Logon to Windows 7 using your usual account.
Launch the cmd prompt - Make sure you select, 'Run as administrator'
Net user administrator p$ssw0rD
Net user administrator /active:yes
Switch User, or logoff
Logon as Administrator Password p$ssw0rD
(Your password may be different!)
Seems what you think is an admin account is really just a user account with sudo rights on certain commands.

Joined: Jan 2008
Posts: 1,133
Likes: 0
From: Bracknell, Berks, UK
I would applaud anything which meant it was harder to edit hosts files rather than easier.
This is because I recommend heavily against doing it, and only choose it as a method of last resort due to the possibility that it can create a world of pain from a troubleshooting perspective when 6 months down the line you've forgotten you've edited the file (or someone else is editing the computer) and the hosts file entry rears it's ugly head.
Much better to either use a DNS server somewhere, or to use IP addresses.
This is because I recommend heavily against doing it, and only choose it as a method of last resort due to the possibility that it can create a world of pain from a troubleshooting perspective when 6 months down the line you've forgotten you've edited the file (or someone else is editing the computer) and the hosts file entry rears it's ugly head.
Much better to either use a DNS server somewhere, or to use IP addresses.
Thread Starter
Joined: May 2001
Posts: 10,804
Likes: 1
Well apparently it doesn't work that one in etc and from my experence it doesn't.
Its in there but if you then try and ping the address it still goes to the dns server and as my local dns server seems to spend more time down than up and there is a bad route to the one I usually use.
Its quite well documented on the web it doesn't do anything.
Normally I would agree with you Mike but its just an entry with pprune and my mail server for when the local DNS server isn't playing ball and there is no route to the one I usually use.
The administrator account though Its very useful to know about. I know its done to protect the user but it makes life so much easier when you use it instead of that sudo account.
Its in there but if you then try and ping the address it still goes to the dns server and as my local dns server seems to spend more time down than up and there is a bad route to the one I usually use.
Its quite well documented on the web it doesn't do anything.
Normally I would agree with you Mike but its just an entry with pprune and my mail server for when the local DNS server isn't playing ball and there is no route to the one I usually use.
The administrator account though Its very useful to know about. I know its done to protect the user but it makes life so much easier when you use it instead of that sudo account.
Hippopotomonstrosesquipidelian title
Joined: Oct 2006
Posts: 1,825
Likes: 1
From: is everything

Joined: Jan 2008
Posts: 1,133
Likes: 0
From: Bracknell, Berks, UK
You did remove the .sam file suffix from "hosts" to leave it as an unsuffixed file, didn't you?
As Windows ships, there's a hosts.sam and an lmhosts.sam which are sample files with sample entries that you need to edit and then rename to remove the .sam (which you'll only see if you've got the folder options set not to hide extensions for known file types.....which is another bugbear!)
As Windows ships, there's a hosts.sam and an lmhosts.sam which are sample files with sample entries that you need to edit and then rename to remove the .sam (which you'll only see if you've got the folder options set not to hide extensions for known file types.....which is another bugbear!)
Thread Starter
Joined: May 2001
Posts: 10,804
Likes: 1
Just doubled checked and its just plain hosts.
In fact just deleted the changes in hosts in /etc and it still resolves it when I screw with the DNS server settings. So there is something a bit strange going on.
Why can't it be as simple as
# vi hosts
insert
67.201.16.181 www.pprune.org
esc
:wq
In fact just deleted the changes in hosts in /etc and it still resolves it when I screw with the DNS server settings. So there is something a bit strange going on.
Why can't it be as simple as
# vi hosts
insert
67.201.16.181 www.pprune.org
esc
:wq

Joined: Jan 2008
Posts: 1,133
Likes: 0
From: Bracknell, Berks, UK
It depends on how your client is set up as to how it decides it's node-type (and hence what hierarchy it uses to resolve names).
I'm going from memory here, but...
If you specifically state DHCP option 46, it'll choose this, but if you don't then it looks at whether you have things like WINS and DNS servers configured, and whether you have a dynamic or static IP address.
A node-type of 0x8 is the best choice IMHO, which gives you name resolution via DNS then WINS then broadcast then hosts then lmhosts, but others are possible.
WINS is deprecated as of Windows 2000 onwards anyway, so you really shouldn't be using that any more, and should remove any WINS servers from your network (and the associated settings in your TCP/IP stack).
Just done a google, and you can manually set the node type in the registry, which might solve your specific issue (not that i'd advocate that normally):
Network Uptime: Troubleshooting WINS Broadcasts
I'm going from memory here, but...
If you specifically state DHCP option 46, it'll choose this, but if you don't then it looks at whether you have things like WINS and DNS servers configured, and whether you have a dynamic or static IP address.
A node-type of 0x8 is the best choice IMHO, which gives you name resolution via DNS then WINS then broadcast then hosts then lmhosts, but others are possible.
WINS is deprecated as of Windows 2000 onwards anyway, so you really shouldn't be using that any more, and should remove any WINS servers from your network (and the associated settings in your TCP/IP stack).
Just done a google, and you can manually set the node type in the registry, which might solve your specific issue (not that i'd advocate that normally):
Network Uptime: Troubleshooting WINS Broadcasts
Thread Starter
Joined: May 2001
Posts: 10,804
Likes: 1
I haven't managed to find those options yet if they give you them at all in the sodding point and click system.
Anyway now I have that administrator account and downloaded the spreadsheet with all the reg entrys that the group policy snap in would tinker with if it was installed I can beat the sod into doing what I want it to do.
Its still a screwed up method of doing things though.
Anyway now I have that administrator account and downloaded the spreadsheet with all the reg entrys that the group policy snap in would tinker with if it was installed I can beat the sod into doing what I want it to do.
Its still a screwed up method of doing things though.
Administrator
Joined: Mar 2001
Aviation Qualifications: PPL
Posts: 8,121
Likes: 686
From: Twickenham, home of rugby
MJ,
Did you flush the DNS cache?
Default name resolution for Win2K+ is:
1. Checks it is own name.
2. Local cache.
3. HOSTS file
4. It will then suffix the Search Suffix configured on the machine, then query DNS
5. WINS
6. Broadcast
7. LMHOSTS
SD
Did you flush the DNS cache?
Default name resolution for Win2K+ is:
1. Checks it is own name.
2. Local cache.
3. HOSTS file
4. It will then suffix the Search Suffix configured on the machine, then query DNS
5. WINS
6. Broadcast
7. LMHOSTS
SD
Thread Starter
Joined: May 2001
Posts: 10,804
Likes: 1
Aye I did.
It seems all a bit bizarre.
I have a feeling that the home editions have been screwed around with to the point of taking the piss.
I have nothing in the hosts file in /etc the DNS server is down and only have an entry in that other hosts file and it resloves pprune, if I swap it to to /etc it can't resolve pprune.
O aye I am linking into the internet using a 3g network so that abortion of a network killer wins isn't in the frame.
It seems all a bit bizarre.
I have a feeling that the home editions have been screwed around with to the point of taking the piss.
I have nothing in the hosts file in /etc the DNS server is down and only have an entry in that other hosts file and it resloves pprune, if I swap it to to /etc it can't resolve pprune.
O aye I am linking into the internet using a 3g network so that abortion of a network killer wins isn't in the frame.
Official PPRuNe Chaplain
Joined: Apr 2001
Posts: 3,498
Likes: 0
From: Witnesham, Suffolk
I've never had a problem editing /hosts on either Win 7 machine, but I did have to change some settings to get the machine to allow me to.
I use hosts as a belt-and-braces to stop the worst of the infected sites. There's a handy ready-sliced hosts file available to download from here.
I use hosts as a belt-and-braces to stop the worst of the infected sites. There's a handy ready-sliced hosts file available to download from here.





