- #Mac os host file location how to
- #Mac os host file location manual
- #Mac os host file location windows
Since it has no extension, the usual double-clicking won’t do. It takes a bit of work to open the host file for editing. By the way, if you move the host file to another location, it no longer has any effect. Now you can manage the file however you do any file, including deleting, renaming, or making a copy of it.
#Mac os host file location windows
Note the address bar that shows the path of the folder.Ĭopy and paste that line onto the address bar of Windows Explorer and hit Enter to quickly get there, as shown in the screenshot above. Here’s the location of the host file on a Windows computer. In the rare case where Windows is installed on another drive instead of c:, change the drive letter accordingly. On a Windows computer, the hosts file always resides at this location: c:\windows\system32\drivers\etc\
#Mac os host file location how to
How to handle the host file on a Windows computer With that, let’s find out where this glorious hosts file resides on your computer and how to edit it. So use 0.0.0.0 or 127.0.0.1 if you want to block all of them.
You can map multiple domains to the same IP. Within the hosts file, each mapping entry (each domain) takes one line. The way it works, every time you want to reach a domain, such as entering it on a browser, the computer will check its hosts file for the mapping, and if the domain is manually mapped, it’ll use that and no longer query a DNS server for the domain.Īnd you can manually map as many domains as you’d like - as long as you know what you’re doing and don’t abuse it. This mapping takes effect system-wide and immediately, meaning it will affect all user accounts of a computer and you don’t even need to restart the computer. And if you use the IP address of another website, the entry becomes a mean prank or a (malicious) hack. Specifically, when you go to, you’ll get a message that the website doesn’t exist or is unavailable.Īlternatively, you can also use 0.0.0.0 as the IP address to get the same effect. This particular example entry binds to the IP of the localhost, the computer itself, and in effect, blocks the computer’s access to Facebook. To be sure you can use a separate entry for each.
(A DNS server is not to be confused with Dynamic DNS, which works somewhat the opposite way.) The hosts file is the original way of binding a domain with an IP address in the early days of inter-connected computers - the foundation of the Internet - before the DNS server came into existence.Ī DNS server is like a public directory of the Internet.
#Mac os host file location manual
It’s a manual way to map a domain, such as, to a particular IP address of your choosing. When edited in a certain way, the hosts file works as the computer’s local DNS mapper. In other words, you can delete the default hosts file, and nothing will happen. It’s there, but it doesn’t do anything other than contain brief information on what it is and how to use it. What the host file is, and how to handle itĮvery computer running Windows, macOS, or Linux has its hosts file.
What the host file is, and how to handle it.