Talk:Hosts file
From Wikipedia, the free encyclopedia
[edit] Improving this Article
Added a history section to provide background on hosts files origins and uses. On my to-do list for this article:
o Fix the crappy formatting, spelling errors, etc o Fix all the technical ambiguity, remove OS prejudices, etc. o Move chunks of the article into a more appropriate article, such as "Hosts_File_Filtering" or something
In general, my aim is to make this NOT look like a freaking IT tech support forum. --Jeff The Riffer 15:07, 4 August 2006 (UTC)
[edit] Proposed move from Host file to Hosts file
hmm, i just noticed something. why is this page titled "Host file"? But, in the Windows environment, it's referred to as a "HOSTS file". And is a file called "HOSTS" which resides in the C:\Windows\System32\drivers\etc directory. —The preceding unsigned comment was added by 24.110.231.35 (talk • contribs) 18:55, 12 July 2005.
- Just to say that on Linux, most distributions (all?) use /etc/hosts; a move to Hosts file would make sense to me --Lox (t,c) 08:43, 12 January 2006 (UTC)
I've marked this with a move template, but since I don't feel it's a controversial move, I am not starting a vote. If anyone feels strongly enough against the move, please feel free to start a vote. --Lox (t,c) 13:56, 12 January 2006 (UTC)
Moved. —Nightstallion (?) 08:37, 16 January 2006 (UTC)
[edit] 0.0.0.0
When you use the 0.0.0.0 method it doesnt try connect anywhere. But if you use 127.0.0.1 it actually tries to connect to a service on your computer which makes it take longer and use up more resources. Also you might run a webserver that it ask for invalid requests. Therefor it is better to use 0.0.0.0 than 127.0.0.1 as you want to kill the connection not to loop it back to your computer. —The preceding unsigned comment was added by Frap (talk • contribs) 16:32, 5 December 2005 (UTC).
- Most websites say it's better to use the 127.0.0.1 method--Andeee 06:46, 5 May 2006 (UTC)
- Why is it better? 0.0.0.0 doesn't connect anywhere. 127.0.0.1 does. If I run a web server that has a virtual host with the same domain name, it would serve the request.
-
- BTW, this page is becoming more of a technical manual than an encylopedia entry.--Avochelm 18:37, 20 May 2006 (UTC)
- Agree completely. The article has an awful lot of second-person in it. That so much of it is written as a 'how-to' makes it difficult to reword otherwise, but I'll take a stab at it. The Monster 06:19, 25 June 2006 (UTC)
- BTW, this page is becoming more of a technical manual than an encylopedia entry.--Avochelm 18:37, 20 May 2006 (UTC)
[edit] Zonealarm spyware
I removed
(Note that ZoneAlarm may itself be spyware. See this article.)
from the article as it a) isn't relevant and b) seems to be an exaggeration. Sum0 21:10, 3 April 2006 (UTC)
[edit] Rephrasing
Changed "Commercial software like ZoneAlarm and Spybot - Search & Destroy have a feature to "lock" the hosts file", as Spybot is not commercial software. --80.61.118.43 12:25, 16 April 2006 (UTC)
[edit] The ROOT Problem
The 'help' in the section is Windows-only. Of course, Windows IS the main enabler of malicious requests everywhere.
It reads like an advertisement... actually, it IS an advertisement for some 'Windows Defender' rubbish. I hope they're paying Wikipedia for that space.
Maybe as a guideline, any "help" in an article of this sort should link to an article about computer security.
Generally, the whole spyware/malware/virus problem boils down to Microsoft's unique insistance on making it 'convenient' for ignorant users by making them log on as 'Administrator' (root) by default. It doesn't help that the 'Home' version of Windows XP that's shipped in most consumer boxes has extremely limited administrative capabilities which give you an extreme radio-button selection of "Omnipotent: Screw Me At Will" or "Somewhat Less Omnipotent: Screw Me Somewhat Less". If you do software development work, you'll need to run a 'Workstation' or 'Server' version of Windows to have the sort of control you need. For most casual users (and kids) a 'User' level account settings will be sufficient for virtually any normal use, though the default 'user' account still allows too much. The question to ask yourself is "$50 extra for the 'Workstation' version, or $500 over the next few years buying junk to 'scan' your computer that doesn't work?"
Most of the garbage that vendors dump on the market to 'protect' users from these 'threats' is nothing more than a patchwork of bandaids cobbled together over the root (sic) problem of excessive login privileges for routine work/entertainment use. Believe me, you really don't want everyone in the house (or office) having privileges to download something they see on a pop-up ad and click "Yes" when it prompts to install... unless you LIKE doing full virus scans weekly and having half a dozen 'protect me' kludges scanning everything on your computer all the time, slowing everything to a crawl, and then re-installing Windows every few months because the damage adds up.
When just editing documents, emailing, browsing the web, etc., a 'user' account (one with limited privileges to change files in a designated place - for windows it might be their subfolder in 'Documents And Settings' and for Unix/Linux users it might be their home folder) is very adequate.
In general, one should only log on with admin/root privileges when deliberately making changes to the system (installing/removing devices and software, adding/editing accounts, that sort of thing). Generally one shouldn't engage in any 'risky' download/browsing behavior while logged in as admin/root. Log off and back on again as a 'user' as soon as you finish.
All well written software that 'behaves' will run fine with user privileges. Software that attempts to do more than the 'user' has privileges to do will fail to modify 'important' files, and (if written well) tell the user why. Older software that makes very dumb assumptions about keeping files in their "Program Files" folder, or modifying system-level registry entries will fail - and this is what Microsoft has made all users into 'Administrators' to enable, so the software based on their earlier, even more flawed non-security model can all still work, while leaving the door wide open for everything else.
If you need to do something, it takes only a minute to log off and log in as 'Administrator' (or type 'su' to become root) and do what needed to be done (usually install a driver or piece of software, occasionally give your 'user' account an extra privilege to enable something), then log back in with your user account. Some software even prompts for the 'Administrator' (or root) password and does this step for you, granting temporary permission to do what you launched it to do.
It should be noted that if you're going to make your current account into 'user', that you'd better make an 'Administrator' enabled one FIRST. I have never met a common Windows user with 'spyware' and 'virus' problems who knows their Administrator account password (many PCs ship to the user brand new and don't have an 'Administrator' password written down anywhere). Set a password on it you'll remember, and write it down anyway and file that away where you can definitely find it. It doesn't have to be the 'Administrator' account. Just an account with 'Administrator' privileges. ONLY after making that administrator account (or at least verifying you can log in as 'Administrator') should you lower your privileges to a 'safe' level. Then make sure your productivity software and toys still work. If some downloaded toy complains, uninstall it and find another one.
Oh, and just a reminder: BACK UP YOUR DOCUMENTS/PICTURES/ETC. A USB2 hard disk big enough to back everything up, and fast enough to do it relatively quickly is dirt cheap compared to the time needed to re-create it all. Best practice is to plug the USB drive in to perform backups, and leave it unplugged, powered off and disconnected the rest of the time. Store the USB drive somewhere separate from your computer (in case of fire, water damage, etc., there will be better chance that ONE hard disk will survive.) If you have a safe backup, there's nothing at all that can happen to your computer that will harm the backed up copies as well. Various vendors make backup software that makes the process incremental and painless (i.e. after the first backup, a weekly backup will usually take a minute or two), but you can just use XCOPY (or ROBOCOPY or 'rsync') to do it if you're comfortable with command line tools.
And one last security tip: Put your most sensitive, sacred, personal things on an EEPROM (USB or whatever memory card format - Back that up, too!) Put all of your sensitive website links and passwords in a file on that stick, too. Clear those automatically entered passwords out of your browser (at least to 'sensitive' things) completely. Now if someone somehow does obtain access to your computer (stolen, accessed locally while you're away, remotely connected, etc.) they find nothing but mundane and uninteresting (and above all HARMLESS) junk. Use that EEPROM like a key and plug it in ONLY when you need that private data. Clear the cache and temp folders after each use of the key. These keys are pretty cheap compared to both losing a notebook AND realizing that your tax records and every login to every bank and credit account are on it, too. If you leave out the MP3s and terabyte of 'videos' you downloaded, a 2GB EEPROM will store anything of significance for most people, and can be hidden much more safely, securely and readily than other media. Mine's even water resistant (or you could keep it in a 'zip-lock' bag.) The computer isn't the important thing, the data on it is what you're worried about. There are additional steps for the extra-paranoid, but that would be one long article.
The EEPROM its self can even be encrypted - but don't count on that encryption protecting data from authorities. If that's a concern, get a tiny-sized one for a digital camera (most cameras have a USB cord and can be read like a hard disk) that you can bite down on and crush if it's a question of "Lost data or prison?" It's a lot harder to recover data from a mashed or fried chip than a disk of whatever type.
[edit] "Use"?
"One use of the hosts file is ad filtering."
The purpose of the HOSTS file is clear, and it's not for ad filtering. It would be more accurate to classify these techniques as something else.
[edit] a better way in XP
The article says you need a work around for XP sp2. this is not true. MS moved the real Hosts file to the windows\I386 directory, edit that one instead, restart, and your done.
[edit] Advertising in article??
As much as it is helpful to state any product name that would relate to Hosts File, I do not believe it is required as it is a form of advertising, unless someone can prove me wrong...
Reeves 05:43, 25 June 2006 (UTC)
[edit] Restart under Windows?
I've never found it necessary to restart a Windows machine for changes to the hosts file to take affect, in fact this is one of the few instances I know of where a restart after a change like this isn't necessary. I've used w9x and w2k, not certain about other versions.
Perhaps the page can be changed to reflect this, I'd do it but I've never edited any pages here before, and perhaps independent confirmation for other Windows versions is necessary.
- JM 16:11 AEST 28/06/2006 --203.76.47.17 06:13, 28 June 2006 (UTC)
- I agree, I've also never needed to restart the computer to reflect changes
- Acrilico 14:43, 30 June 2006 (UTC)
- strange, I have always had to restart for any changes to take effect in w9x, w2000, and xp pro
-
- I usually restart the internet browser for changes, but I don't restart the whole computer
- Reeves 20:49, 15 July 2006 (UTC)
-
- The nbtstat -R command works too... Also it works even with the DHCP Client service running. See http://support.microsoft.com/default.aspx?scid=kb;en-us;Q180094
- Benad
[edit] lmhosts
I think the Windows Quirks section of this article should also discuss the lmhosts file. How does this relate to the hosts file? Does Windows attempt to synchronize these at all?
- This article at tek-tips.com seems to discuss it. Perhaps somebody with better understanding of Windows/WINS networking could distill into something for the article? Dharris 14:54, 5 July 2006 (UTC)
[edit] Ether
Please help clarify the entry in the "aether" disambiguation page: "in internet routing, the term ether is associated with hosts" What the heck is it? (Previously "hosts" was a redirect to "hosts file") `'mikka (t) 17:38, 17 July 2006 (UTC)
[edit] Add section about downloadable hosts files
This article also needs a section about hosts file that can be downloaded and installed on user systems. Would be great to have direct links to site that maintain hosts files of known/acknowledged malware sites, adult content sites, etc.
[edit] hosts, not HOSTS
Under the Location heading, I changed the name of the file from "HOSTS" to "hosts", reversing the change that 4.225.172.115 made on 3 August 2006; the rationale being that on Unix-like systems, file names are case sensitive and for them the file is named "hosts". On Windows, the names are not case sensitive, so "hosts" should work there as well. FWIW, every Windows system I've examined displays the name in lowercase anyway, so I can't imagine any objection. —Ksn 18:15, 22 August 2006 (UTC)
[edit] dns client service
I've heard different views detailing the "DNS Client" service on Windows XP (and I assume other versions of Windows with that service). It's not that Windows "ignores" the HOSTS file, but it tries to load the _complete_ HOSTS file into this "cache", resulting in web surfing/domain name resolution taking very long to work, since it has to go through so many entries. And well, look at the external links, many of those HOSTS files are greater than 1-2MBs, so having to search through every entry, for every DNS lookup makes Internet sites to seem slow. --70.152.196.25 02:34, 29 August 2006 (UTC)
[edit] Ad Filtering
I do not believe that real ad sites should be used as examples in a negative way such as this. It is unfair to single these companies out on such a highly trafficked and is not Neutral. Instead, I think there should be a section on host file syntax before the 'Ad Filtering' section. The syntax section should use the officially sanctioned 'example.com' address. The 'Ad Filtering' section should not show examples, but keep the explanation on how and why it is done. One of the external links could be to a site that provides lists of hostnames to add to your host file. These lists are
- Far more complete
- Fair to competing agencies by attempting to be all-encompassing
Loplin 01:04, 13 December 2006 (UTC)
- I went ahead and added the syntax section and removed the 'Ad Filtering' Examples.Loplin 01:52, 13 December 2006 (UTC)