Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

ominx

macrumors 6502
Original poster
Jun 23, 2010
356
9
I have a pretty extensive hosts file that I use to block sites. Prior to 10.10 everything worked as it should. Since upgrading to 10.10 it seems as though all entries in the hosts file are ignored. I have tried moving all entries to the top before the localhost loopback, flushed cache, and rebooted. In all cases the entries are ignored.

Has anyone experienced this? Any ideas or reasons why this is happening?

Thanks.
 

pmz

macrumors 68000
Nov 18, 2009
1,949
0
NJ
Its beta.

Or, Apple may be cracking down on the way Host files are used to fake activation for pirated software.
 
Comment

HyperliteG4

macrumors regular
Jul 18, 2002
209
99
Southern California
Mine seems to behave as expected. I do a lot of local web development, so I edit my hosts file all the time.

I did have some issues with my Apache configuration due to Apache being upgraded from 2.2 to 2.4, but I was able to resolve these.
 
Comment

ominx

macrumors 6502
Original poster
Jun 23, 2010
356
9
Its beta.

Or, Apple may be cracking down on the way Host files are used to fake activation for pirated software.

Missed the memo that the "It's a beta" mantra has commenced. Guess we should all crawl under a rock until the final release. ;)

The hosts file is located on every single operating system out there. I really don't think Apple is all of a sudden ignoring it because thieves out there want to steal software. It has a pretty important purpose which is beyond this thread.

Sure, it there can be a bug in 10.10 that causes the entries to be ignored. Or possibly it has moved somewhere from the normal location found on every UNIX based OS (private/etc/hosts). But that is the point of my question and hopefully discussion.

----------

Mine seems to behave as expected. I do a lot of local web development, so I edit my hosts file all the time.

I did have some issues with my Apache configuration due to Apache being upgraded from 2.2 to 2.4, but I was able to resolve these.

See! Believe it or not.... not everyone is a pirate!

Thanks for the reply. At least I know it's still where it's supposed to be. ;)
 
Comment

justblais

macrumors member
Jun 24, 2013
67
0
Has anyone else had an issue where sudo nano private/etc/hosts...doesn't yield the hosts file? It's completely blank..

I'm having issues with one of my test devices being "not eligible" for updating to iOS 8, despite being on my dev profile. Usually when this happens it's just a hosts file issue and I can fix it and go, but after my update to yosemite that command doesn't seem to get me where I need to be.
 
Comment

Intell

macrumors P6
Jan 24, 2010
18,912
433
Inside
Has anyone else had an issue where sudo nano private/etc/hosts...doesn't yield the hosts file? It's completely blank..

I'm having issues with one of my test devices being "not eligible" for updating to iOS 8, despite being on my dev profile. Usually when this happens it's just a hosts file issue and I can fix it and go, but after my update to yosemite that command doesn't seem to get me where I need to be.

Check the alternative place where it's store on other UNIX systems, /etc/hosts. That's where it should be, not a symlink like Apple has done in the past.
 
Comment

justblais

macrumors member
Jun 24, 2013
67
0
Check the alternative place where it's store on other UNIX systems, /etc/hosts. That's where it should be, not a symlink like Apple has done in the past.

This worked! Now to figure out why it won't properly authenticate that the device is eligible....

Thank you though! Simple mystery SOLVED.
 
Comment

ljakab

macrumors newbie
Jun 7, 2014
1
0
how it's solved?

Would you be so kind to elaborate... What is the solution?

I have the same problem but /etc/hosts is sym. link to /private/etc/hosts and
whatever I put there it gets ignore unfortunately.
 
Comment

Watabou

macrumors 68040
Feb 10, 2008
3,424
753
United States
Would you be so kind to elaborate... What is the solution?

I have the same problem but /etc/hosts is sym. link to /private/etc/hosts and
whatever I put there it gets ignore unfortunately.

/etc/ is actually a symlink to /private/etc so yes, /private/etc/hosts is the correct location for the hosts file.

Same problem

Its not working for me either. I need to edit my websites without uploading via ftp every minute. This is terrible!

Open up Terminal.app and issue:

Code:
dscacheutil -flushcache

to flush the cache. My adblock hosts file is working perfectly.
 
Comment

Wire_Apple_Geek

macrumors newbie
Mar 6, 2002
8
0
Durham NC
You can also use the directory service. Apple has been moving everything to it for some time, so I can imagine that they could deprecate the hosts file at some point.

For more info, look here: https://tomafro.net/2009/07/dscl-the-easy-way-to-add-hosts-on-osx

Best I can tell though this only works with .local domains though which when interlinking multiple websites or iOS apps that you need to define the full domain for this doesn't do much good, any chance you know how to make it work with .coms and similar?
 
Comment

leman

macrumors G5
Oct 14, 2008
12,873
8,236
Best I can tell though this only works with .local domains though which when interlinking multiple websites or iOS apps that you need to define the full domain for this doesn't do much good, any chance you know how to make it work with .coms and similar?

Right, I should have tried it out myself before suggesting it, sorry :eek: It seems that this feature no longer works since Lion or so (from what I found on the net). Seems that hosts is still the way to go.

P.S. It also does not work with localhost aliases on Yosemite, the whole Hosts node is ignored.
 
Comment

matthewadams

macrumors 6502
Dec 6, 2012
253
67
As of 10.10 mDNSResponder as a separate daemon is deprecated and included in the newer discovery daemon.
Its shared functionality can be seen in the plist file:
cat /System/Library/LaunchDaemons/com.apple.discoveryd.plist

At least on my end, I have no problems with discoveryd and the /etc/hosts file

If theres any need to reload the dns daemon this would be the way i guess:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
 
Comment

cubbox

macrumors newbie
Oct 13, 2014
1
0
As of 10.10 mDNSResponder as a separate daemon is deprecated and included in the newer discovery daemon.
Its shared functionality can be seen in the plist file:
cat /System/Library/LaunchDaemons/com.apple.discoveryd.plist

At least on my end, I have no problems with discoveryd and the /etc/hosts file

If theres any need to reload the dns daemon this would be the way i guess:

Brilliant this worked perfectly. Thanks
 
Comment

scotty588

macrumors 6502
Jan 2, 2007
465
59
Carlsbad, CA
I'm noticing the command I usually use to launch TextEdit to edit my host file no longer works in Yosemite.

Code:
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts

Is there something I'm missing here?
 
Comment

leman

macrumors G5
Oct 14, 2008
12,873
8,236
I'm noticing the command I usually use to launch TextEdit to edit my host file no longer works in Yosemite.

Code:
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts

Is there something I'm missing here?

You are making it way too complicated. Why not just

sudo open -a TextEdit /etc/hosts

?
 
Comment

viizi

macrumors regular
Dec 2, 2010
224
68
That works. Thanks!

that is cool but when it opens the document is locked and it tries to make a duplicate to make any changes. Any way to have it unlocked? I thought sudo would have taken care of that.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.