What is the OS X equal to Windows HOSTS file?

Joined
Sep 30, 2004
Messages
3,378
Reaction score
61
Points
48
For those that don't know about the Window HOSTS file, it allows you to set the IP address that goes with a host name. For example the IP address for the host name mac-forums.com is 69.20.37.125. So if you didn't want your computer to be able to access mac-forums you could redirect that host name to go to some other IP, like 0.0.0.0 which would lead it no where. Anyone know how to do that in OS X?
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
Like meltbanana314 suggested you would find it in /etc. but I think in OS X it is located in /private/etc.

Run the terminal application and execute the following line:

sudo find / -name hosts -exec ls -l {} \;

The above should give you the full path (location) of the host file.
 
Joined
Jun 11, 2003
Messages
4,915
Reaction score
68
Points
48
Location
Mount Vernon, WA
Your Mac's Specs
MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
Yeah it's found in /etc/hosts or /private/etc/hosts they both point to the same file.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top