Senior Member
Join Date: May 2004
|
So I did a search and found an old thread I remembered that had directions for modifying the hosts file. I downloaded a modified hosts file that CubeDude linked to in this thread. I added a few specific URLs to the file, then followed the directions that Brad gave, replaced the old hosts file with the modified one, ran "lookupd -flushcache" in Terminal, and nothing seems to have happened. There are still ads on all the pages I go to and I can still access the sites that I added to the file myself. What am I doing wrong?
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Quit and relaunch your browser.
That's a step that I often forget too. |
quote |
Senior Member
Join Date: May 2004
|
Unfortunately, it's not so simple as that. First, I was logged in as root to change the file, so I've logged out and back in in my regular account and I've quit and reopened the browser a couple of times. It's possible that the ads I'm seeing are coming from servers that aren't on the list, since I've noticed a couple of missing image icons on pages, but if that's the case, PithHelmet did a much better job blocking ads and I'll go back to that. Of course that still doesn't explain why I can still get to sites I added myself. I put in lines to match all the others that were there, i.e. "127.0.0.1 nameofsite.com" but going to nameofsite.com works just fine.
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Use used the root user?! Well, there's your problem! Logging in as the room user can futz up all kinds of things, especially in the Finder. Repair permissions! Zap the PRAM! Defrag your hard drive! And recompile your kernel!
No, you don't need to do all that, but using root in the GUI is a very bad idea and can cause unexpected problems, especially in the Finder. Okay, now that that's said and done: Fire up Terminal and show us what this command gives you: lookupd -configuration The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting. |
quote |
Senior Member
Join Date: May 2004
|
First off, FMI (for my information), how would have modified the file without logging in as root? I tried doing it through my own administrator account, but couldn't save (as I expected). I still know relatively little about working in a CLI.
Second off, lookupd -configuration gives the following: ConfigSource: default LookupOrder: Cache NI DS MaxIdleServers: 4 MaxIdleThreads: 2 MaxThreads: 64 TimeToLive: 43200 Timeout: 30 ValidateCache: YES ValidationLatency: 15 _config_name: Global Configuration LookupOrder: Cache FF DNS NI DS _config_name: Host Configuration LookupOrder: Cache FF NI DS _config_name: Service Configuration LookupOrder: Cache FF NI DS _config_name: Protocol Configuration LookupOrder: Cache FF NI DS _config_name: Rpc Configuration TimeToLive: 60 ValidateCache: NO _config_name: Group Configuration TimeToLive: 300 ValidateCache: NO _config_name: Initgroup Configuration LookupOrder: Cache FF DNS NI DS _config_name: Network Configuration EDIT: I know working in root can be risky, so I am always careful to do only what I came to do (not that I log in as root very often; only occasionally). |
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Hmm. That is odd indeed. Everything appears to be in the correct order.
How did you create the hosts file? TextEdit? Get info on the file and make sure it isn't retaining the .txt extension. To modify the file without using root or the Terminal, simply navigate to /etc in the Finder (Go -> Go to Folder...), drag the file to your desktop (it'll make a copy), edit it and save it, drag it back into /etc while holding the option key. This will copy it back, asking you to authenticate. There's always a way to get things done without resorting to the root user. All you have to do is ask. The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting. |
quote |
Senior Member
Join Date: May 2004
|
Well, thanks for the help. I'm not sure what the deal is. At first it was reading the .txt extension, but I figured that out and fixed it. Didn't seem to make a difference though. Oh well. I guess I'll just go back to Pith Helmet...maybe try this again some other time.
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Pfft. Don't think that I give up that easily! E-mail me your file. brad@applenova.com
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Check your e-mail.
|
quote |
25 chars of wasted space.
|
Quote:
Now ast3r3x...RARELY is that taken |
|
quote |
Lord of the Rant.
Formerly turtle2472 Join Date: Mar 2005
Location: Upstate South Carolina
|
Bump!
So I'm trying to update my hosts file in Leopard and now it just doesn't seem to be working at all. I should have left it alone after upgrading but I have been seeing to many ads left over. So I went to edit my hosts.txt file and found most of the ads I wanted to block were listed in my hosts files already. There were two hosts files in my /etc folder and so I deleted the one that was empty. I ended up having to change the permission so that everyone had read only access I also added Administrators to the list with read only access. Well then to the next step of running "lookupd -flushcache" from Terminal but I get a message back saying: -bash: lookupd: command not found So did Apple change the commands in Terminal? What am I missing? Now none of my ads are being blocked. I've tried rebooting and still nothing. Leopard 10.5.1, MB CD 2GHz Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.” Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it. |
quote |
‽
|
|
quote |
Lord of the Rant.
Formerly turtle2472 Join Date: Mar 2005
Location: Upstate South Carolina
|
Thanks!
Now my ads are all blocked again but they all have an error message instead of just being blank. Quote:
|
|
quote |
‽
|
|
quote |
Lord of the Rant.
Formerly turtle2472 Join Date: Mar 2005
Location: Upstate South Carolina
|
Not at this house. I'm at my mom's now and there is no server or anything here. I don't even have the web sharing turned on on this MB either.
Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.” Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it. |
quote |
Veteran Member
Join Date: May 2004
Location: Promise Land of Trustafarians
|
Quote:
Either way, you might try turning the webserver on your MacBook on and setting the .htaccess file to send an empty string of text in place of a 404 error. Be sure to set the firewall to block incoming requests to port 80. |
|
quote |
Lord of the Rant.
Formerly turtle2472 Join Date: Mar 2005
Location: Upstate South Carolina
|
Quote:
Quote:
Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.” Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it. |
||
quote |
Lord of the Rant.
Formerly turtle2472 Join Date: Mar 2005
Location: Upstate South Carolina
|
Any new updated hosts files out there? Just want to update mine and thought I'd check for anyone who keeps theirs more updated than I have.
|
quote |
Custom User Title
Join Date: Jul 2006
Location: At home
|
Bump !
Hey guys I want to block a site. I want to block www.MySite.com so I edited the host file and it works. The problem is that I can use a link like www.MySite.com/FuckYouHostFile.html to acces the site Edit: Wuh !?!? It's working now. I played a little bit with it and then, wanted to make it as it was. And now it works. The only difference is that I added www.MySite.com instead of MySite.com in the host file. Rep point for me ! Dave Mustaine :"God created whammy bars for people who don't know how to solo." |
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Quote:
For example, to block some ad servers, you have to block a slew of domains like this: Code:
0.0.0.0 adserver.com
0.0.0.0 images.adserver.com
0.0.0.0 a1.adserver.com
0.0.0.0 a2.adserver.com
0.0.0.0 a3.adserver.com
0.0.0.0 a4.adserver.com
0.0.0.0 a5.adserver.com Alternatively, you can put many domains on a single line:Code:
0.0.0.0 adserver.com images.adserver.com a1.adserver.com a2.adserver.com ...and so forth.The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting. |
|
quote |
is the next Chiquita
Join Date: Feb 2005
|
Out of curiosity, is there a particular reason for not incorporating support for wildcard match in hosts file?
|
quote |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Short of being consistent with how other systems do it, I have no idea.
|
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PHP : loading a multi-dimensional file with a loop | drewprops | Genius Bar | 6 | 2005-02-03 23:05 |
Modified Hosts File? | SledgeHammer | General Discussion | 1 | 2005-02-02 20:34 |
CSI: htaccess file | drewprops | Genius Bar | 3 | 2004-09-21 15:52 |
iView MediaPro and the file system | chucker | Genius Bar | 0 | 2004-09-05 13:24 |
Different file systems with OS X... | Purgatos | General Discussion | 13 | 2004-08-15 12:48 |