Edit a host file in windows


















Use precise geolocation data. Select personalised content. Create a personalised content profile. Measure ad performance. Select basic ads. Create a personalised ads profile. Select personalised ads. Apply market research to generate audience insights.

Measure content performance. Develop and improve products. List of Partners vendors. By Mary Landesman Mary Landesman. Mary Landesman is a former freelance contributor to Lifewire and a security expert. She was named as one of the women to watch in IT security. Reviewed by Ryan Perian. Tweet Share Email. Was this page helpful? Don't want friends or family to visit certain websites on your computer? Or are you like me and get distracted by all the cat photos on the internet? Also, close the browser windows that are open and reopen them.

The one downside is that this only works on one device — you could just reach for your phone and browse Reddit on that instead. Still, it's a neat way to create some friction on your work computer. This leads nicely into the last trick, which is to use the hosts file to make your life a little bit easier. If you spend a lot of time adjusting your router's settings, or you have a cool project running on a Raspberry Pi , you'll know that typing in a long IP address is a drag. Instead, you can use the hosts file to make connecting to other devices on your local network much faster.

For example, if your router is at Otherwise your browser might not recognize. Fortunately there are a whole lot of valid TLDs nowadays. Again, the one downside to this method is that it only works on once device.

You'd have to update the hosts files on your other devices to enable the same shortcuts. And that should be just about everything you need to know about the hosts file on Windows And a lot of this knowledge should carry over to Linux and macOS. Did you find this helpful? Are there any other hosts file tricks you know? Let me know over on Twitter. If you read this far, tweet to the author to show them you care. Tweet a thanks.

Learn to code for free. Get started. Forum Donate. Kris Koishigawa. But knowing where it is and how it works can be helpful if: you're having trouble with local development you suspect malware has tampered with the hosts file you want a quick and simple way to block some websites or if you want to set up some helpful shortcuts to internal IP addresses In this article we'll cover what a hosts file is , how to edit it on Windows , and we'll go over some neat tricks you can do with it.

What's a hosts file anyway? For example, here's a line you'll find in many hosts files on Windows, Linux, and macOs: Why hosts files fell out of favor The hosts files system worked well for the early internet, but there were a few major problems. As you can imagine, hosts files would get complicated, fast. The solution If you're thinking that someone should have just made a central repository to map all IP addresses with all hostnames, that's exactly what happened.

Type notepad into the search bar. Don't click anything yet—just type the word and wait for the search results to appear. Right-click Notepad in the search results. A menu will expand. Click Run as administrator. This opens Notepad as an administrator. You may have to click Yes on a security warning to open the app. Click the File menu and select Open.

This opens your file chooser. Navigate to the path that contains the hosts file. You can paste that path into the bar at the top of the window and press Enter to go there. It's the menu toward the bottom-right corner of the window.

You should now see a handful of files, including the hosts file. The hosts file is now open for editing. Make changes to the file. Now that the file is open, you can add the correct lines to the file. When you add a line to the hosts file, you'll want to enter the IP address first, followed by the domain name you're mapping it to. Separate the two with a space or a tab, and keep each entry on its own line. Instead of deleting a line, just add a hash symbol to the beginning.

This way you can easily reactivate old entries if you accidentally disable something you needed. Click the File menu and select Save. This saves your changes to the hosts file. Include your email address to get a message when this question is answered. By using this service, some information may be shared with YouTube.



0コメント

  • 1000 / 1000