Wikiposts
Search
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

Windows 7 hosts file

Thread Tools
 
Search this Thread
 
Old 14th Oct 2010, 22:55
  #1 (permalink)  
Thread Starter
 
Join Date: May 2001
Posts: 10,815
Likes: 0
Received 0 Likes on 0 Posts
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

CWindows\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.
mad_jock is offline  
Old 14th Oct 2010, 23:27
  #2 (permalink)  
 
Join Date: May 2003
Location: UK
Posts: 154
Likes: 0
Received 0 Likes on 0 Posts
Agreed
gizmocat is offline  
Old 14th Oct 2010, 23:32
  #3 (permalink)  
Thread Starter
 
Join Date: May 2001
Posts: 10,815
Likes: 0
Received 0 Likes on 0 Posts
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.
mad_jock is offline  
Old 15th Oct 2010, 00:08
  #4 (permalink)  
 
Join Date: Jan 2008
Location: Bracknell, Berks, UK
Age: 52
Posts: 1,133
Likes: 0
Received 0 Likes on 0 Posts
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.
Mike-Bracknell is offline  
Old 15th Oct 2010, 04:09
  #5 (permalink)  
 
Join Date: Dec 2005
Location: Wellington,NZ
Age: 66
Posts: 1,678
Received 10 Likes on 4 Posts
Never had a problem using the MVPS hosts file in XP.

Stops a lot of ads, as well as known dodgy sites, too. Always worked flawlessly for me.

Can't wait till support is withdrawn for XP...not!
Tarq57 is offline  
Old 15th Oct 2010, 06:13
  #6 (permalink)  
More bang for your buck
 
Join Date: Nov 2005
Location: land of the clanger
Age: 82
Posts: 3,512
Likes: 0
Received 0 Likes on 0 Posts
Only ever edited hosts in the regular "etc" location - by right click in Notepad and run as Admin. Works for me. (Windows 7 x64).
Yep, works for me too.
green granite is offline  
Old 15th Oct 2010, 08:35
  #7 (permalink)  
Thread Starter
 
Join Date: May 2001
Posts: 10,815
Likes: 0
Received 0 Likes on 0 Posts
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.
mad_jock is offline  
Old 15th Oct 2010, 10:06
  #8 (permalink)  
Hippopotomonstrosesquipidelian title
 
Join Date: Oct 2006
Location: is everything
Posts: 1,826
Likes: 0
Received 0 Likes on 0 Posts
Obligatory sudo comic

sudo
xkcd: Sandwich
Bushfiva is offline  
Old 15th Oct 2010, 12:56
  #9 (permalink)  
 
Join Date: Jan 2008
Location: Bracknell, Berks, UK
Age: 52
Posts: 1,133
Likes: 0
Received 0 Likes on 0 Posts
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!)
Mike-Bracknell is offline  
Old 15th Oct 2010, 13:20
  #10 (permalink)  
Thread Starter
 
Join Date: May 2001
Posts: 10,815
Likes: 0
Received 0 Likes on 0 Posts
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
mad_jock is offline  
Old 15th Oct 2010, 18:46
  #11 (permalink)  
 
Join Date: Jan 2008
Location: Bracknell, Berks, UK
Age: 52
Posts: 1,133
Likes: 0
Received 0 Likes on 0 Posts
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
Mike-Bracknell is offline  
Old 15th Oct 2010, 19:08
  #12 (permalink)  
Thread Starter
 
Join Date: May 2001
Posts: 10,815
Likes: 0
Received 0 Likes on 0 Posts
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.
mad_jock is offline  
Old 15th Oct 2010, 19:34
  #13 (permalink)  
 
Join Date: Jan 2008
Location: Bracknell, Berks, UK
Age: 52
Posts: 1,133
Likes: 0
Received 0 Likes on 0 Posts
Its still a screwed up method of doing things though.
No argument here. Bring back win.ini and system.ini, and make programs totally modular and 'fork-liftable'
Mike-Bracknell is offline  
Old 15th Oct 2010, 20:33
  #14 (permalink)  
Spoon PPRuNerist & Mad Inistrator
 
Join Date: Sep 2003
Location: Twickenham, home of rugby
Posts: 7,390
Received 245 Likes on 163 Posts
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
Saab Dastard is offline  
Old 15th Oct 2010, 20:40
  #15 (permalink)  
Thread Starter
 
Join Date: May 2001
Posts: 10,815
Likes: 0
Received 0 Likes on 0 Posts
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.
mad_jock is offline  
Old 15th Oct 2010, 22:02
  #16 (permalink)  

Official PPRuNe Chaplain
 
Join Date: Apr 2001
Location: Witnesham, Suffolk
Age: 80
Posts: 3,498
Likes: 0
Received 0 Likes on 0 Posts
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.
Keef is offline  
Old 15th Oct 2010, 22:16
  #17 (permalink)  
Thread Starter
 
Join Date: May 2001
Posts: 10,815
Likes: 0
Received 0 Likes on 0 Posts
What version have you got keef?
mad_jock is offline  
Old 15th Oct 2010, 23:39
  #18 (permalink)  

Official PPRuNe Chaplain
 
Join Date: Apr 2001
Location: Witnesham, Suffolk
Age: 80
Posts: 3,498
Likes: 0
Received 0 Likes on 0 Posts
Winhelp 2002? It's the January 2010 version. I've not bothered to update it since.
Keef is offline  
Old 16th Oct 2010, 03:04
  #19 (permalink)  
Thread Starter
 
Join Date: May 2001
Posts: 10,815
Likes: 0
Received 0 Likes on 0 Posts
No the version of Windows 7 Basic, Premuim,Pro or Ultimate.
mad_jock is offline  

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.