Hosts Files?

Status
Not open for further replies.
V

vonedaddy

Guest
I am a long time windows user and I am new to the mac so please bare with me.

With my windows xp machine I used to have a HOSTS file where I can store DNS information locally and the browser would check there for DNS resolution before going to the DNS servers. Is that possible with a MAC?
 
Joined
Mar 30, 2004
Messages
4,744
Reaction score
381
Points
83
Location
USA
Your Mac's Specs
12" Apple PowerBook G4 (1.5GHz)
It's at /etc/hosts

If the above confuses you, then do the following:
- Open the Terminal application (In the Utilities folder, inside the Applications folder of your hard disk)
- type
Code:
open /etc/hosts
and press Return
The Hosts file should open in a text editor.
 
Joined
Jan 8, 2005
Messages
6,188
Reaction score
254
Points
83
Location
New Jersey
Your Mac's Specs
Mac Pro 8x3.0ghz 12gb ram 8800GT , MBP 2.16 2GB Ram 17 inch.
I am interested in what you are changing in this file, a description would be much apprieated so I can learn something.
 

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
He maybe adding an entry to the file. An entry would look something like the following (ip address hosts name):

123.32.12.125 gandalf
 
Joined
Mar 30, 2004
Messages
4,744
Reaction score
381
Points
83
Location
USA
Your Mac's Specs
12" Apple PowerBook G4 (1.5GHz)
PowerBookG4 said:
I am interested in what you are changing in this file, a description would be much apprieated so I can learn something.

1. Shortcuts, like localhost.
2. Ad blocking. For example, redirect all request to ads.advertiser.com to 127.0.0.1, and web ads from that advertiser will disappear. (You can find lists of popular advertisers' servers, like Doubleclick's, on Google)
3. Filtering. Suppose your roommate shares your iMac. Suppose he likes porn. Suppose you don't want him browsing porn on your computer. Redirect all requests to www.hisfavoritepornosite.com to 127.0.0.1
 
Joined
Jan 8, 2005
Messages
6,188
Reaction score
254
Points
83
Location
New Jersey
Your Mac's Specs
Mac Pro 8x3.0ghz 12gb ram 8800GT , MBP 2.16 2GB Ram 17 inch.
that is prety cool, how did you do this on the pc, because I would like to do that on my pc as well.
 
Joined
Jan 19, 2007
Messages
130
Reaction score
9
Points
18
Location
Pennsylvania
Your Mac's Specs
MacBook Pro-2.16Ghz Intel Core 2 Duo-3GB RAM-120GB HDD
PowerbookG4,
The host file on a pc is located at c:\windows\system32\drivers\etc\

The file name is hosts (no file extension). If you use notepad to edit, make sure when you save you save it as "hosts" including the quotes otherwise it will ad a .txt extension and won't work.
 
Status
Not open for further replies.

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