Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Speed internet browsing via a local domain name server UNIX
Anyone who has 'switched' to the Mac, or has experience on a PC, knows that the PC makes the Mac look like a dog when it comes to web browsing. This is true for all browsers on the Mac. It turns out this has less to do with the end-user applications and really centers around DNS (Domain Name Server) lookups. The major bottleneck in our systems seems to be initial contact with the websites. We are having to make every single request to an external DNS server, thus creating a lag in initial response. Considering OS X is UNIX, this is completely unnecessary. We have a perfectly good DNS server (BIND) that is turned off by default.

In order to drastically improve web browsing experience, we will enable a local caching name server. This will require sudo privileges and comfort in the Terminal. We will be using the command-line text editor pico here, as TextEdit will not execute properly as root.

[robg adds: I haven't tested this hint ... and it does require a high level of comfort in the Terminal. Consider yourselves forewarned...]

A few things to remember before we start...
  • Capitalization is important!
  • Terminal commands are shown in orange, and preceded by a # prompt character (don't type that!).
  • Comments are shown below commands, and /* surrounded by comment markers */. Don't type the comments.
  • Text you should be pasting is in orange italics.
And now, the step-by-step...
  1. Start a root Terminal session

    Open a Terminal session and launch a root shell by typing sudo bash. The rest of the instructions assume every step is done in this root shell!

  2. Set up your machine to run the BIND server.
    # rndc-confgen > /etc/rndc.conf 
      /* creates rndc.conf and generates key */
    # head -n 6 /etc/rndc.conf > /etc/rndc.key
      /* parses the key into the proper file */
    # pico -w /etc/named.conf
      /* opens the BIND configuration file for editing in the text editor */
    
    Add the following into the options section, where x.x.x.x represents the IP addresses of either your ISP, or other DNS servers, known to you (Google for DNS servers if you don't know of any):
    forwarders {
    x.x.x.x;
    x.x.x.x;
    };
    
    Save the file and quit the editor. Hit Control-O, Enter, then Control-X.

  3. Create StartupItem for DNS [10.4 only; otherwise jump to next step]

    It seems as if Tiger has removed the (already disabled in Panther) DNS Server completely from StartupItems. We have to add it if running Tiger.
    # cd /System/Library/StartupItems
    # mkdir BIND
    # cd BIND
    # touch BIND; pico -w BIND
      /* Create first of two files, then open it in text editor */
    
    Copy the following into the file, save it, and exit:
    #!/bin/sh
    
    . /etc/rc.common
    
    if [ "${DNSSERVER}" = "-YES-" ]; then
      ConsoleMessage "Starting BIND DNS Server"
      /usr/sbin/named
    fi
    
    $ touch StartupParameters.plist; pico -w StartupParameters.plist
      /* Create and open second of two files needed */
    
    Copy the following into the file,save it, and exit:
    {
      Description = "Local Caching DNS Server";
      Provides = ("DNS Server");
      OrderPreference = "None";
      Messages = 
      {
      start = "Starting BIND DNS Server";
      stop = "Stopping BIND DNS Server";
      };
    }
    
    $ chmod +x BIND
      /* Make the script executable so it can actually be run */
    
  4. Enable DNS on boot
    # pico -w /etc/hostconfig
      /* Open the file OS X reads to start services */
    
    Change it to make DNSSERVER=-YES-. Here Tiger users will have to add this value; Panther users will simply change it to -YES-. Save the file and exit.

  5. Finish up with root
    # exit
      /* End root shell */
    
  6. Tell OS X to use your local DNS

    Open System Preferences, then the Network preferences panel. Change your 'DNS Server' setting to 127.0.0.1 for all the connections you use. This step is crucial, as failing to do so will make all your hard work completely useless.

    Finally, either reboot, or issue the following command in the terminal:
    $ sudo /System/Library/StartupItems/BIND/BIND
    
That's it -- enjoy your new internet connection!
    •    
  • Currently 2.93 / 5
  You rated: 2 / 5 (15 votes cast)
 
[192,466 views]  

Speed internet browsing via a local domain name server | 70 comments | Create New Account
Click here to return to the 'Speed internet browsing via a local domain name server' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Speed internet browsing via a local domain name server
Authored by: frogmella on May 04, '05 11:24:45AM

You should NOT do this if your Internet connection goes through any sort of local broadband router as this will be providing a local DNS service for you anyway.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: bcamp1973 on May 04, '05 11:29:19AM

How do you go about checking to see if you have a local broadband router? I'm interested in doing whatever i can to speed up my experience, but i don't want to cause other issues in the process :)



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: bcamp1973 on May 04, '05 11:34:13AM

Ok, i'm an idiot...nevermind. I wasn't paying attention to what i was reading. I do have a local router. However, its settings only refer to Dynamic DNS (DDNS). There are no settings for regular DNS. Does this mean the router doesn't have this functionality or is it just not adjustable/accessible?



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: ghz on May 04, '05 01:28:59PM

most soho boradband routers do have dns service built in, and propagate themself as the local dns server in the dhcp lease..
usually this is a small caching dns forwarder.. (such as dnsmasq..)



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: frogmella on May 05, '05 05:24:02AM

Best way to see if your local router does DNS is to do a verbose name query: from a terminal window, type:
host -v www.apple.com

The last line of this gives the DNS server you're using, for example:
Received 85 bytes from 192.168.0.1#53 in 24 ms

This is a 'private' IP address to your network (anything beginning 192.168. or 10. is) and will be only one digit different from the IP address of your Mac (found in Network Preferences) if it's using a local (router) DNS.

If you're using your ISP's DNS, it will be completely different, for example:
Received 85 bytes from 194.73.73.113#53 in 117 ms
- and this hint may well help you.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: digitaltvguy on May 04, '05 11:42:38AM

This hint caches the DNS queries. That's what optimizes the lookup. Is that correct?

---

-Chris



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: aurelius on Nov 27, '05 10:48:27AM

The simplest solution may be to just check that the 'optional' DNS server names box in the Network System Preferences is BLANK!

That did the trick for me.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: gbullman on Dec 23, '06 10:26:40AM

This hint is working well for me, but as originally suggested it was not automatically starting when the computer started up. Using other StartupItems as examples, I think the /System/Library/StartupItems/BIND/BIND script has to look like this to actually start the service as the machine boots up;

#!/bin/sh

. /etc/rc.common


StartService ()
{
if [ "${DNSSERVER}" = "-YES-" ]; then
ConsoleMessage "Starting BIND DNS Server"
/usr/sbin/named
fi

}

StopService ()
{
return 0
}

RestartService ()
{
return 0
}

RunService "$1"



(RunSevice... is last line in BIND script) Now it is starting up fine each time the machine starts up.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: ryanmathus on May 04, '05 11:26:27AM

Works for me - seems like the initial visit (first visit) to a website after applying this hint is a bit slower than normal but once you have visited the site, it's much snappier.

Using Panther by the way - have yet to install Tiger...

Nice hint :-)

---
-Ryan



[ Reply to This | # ]
Works in 10.3.9 with modifications
Authored by: terceiro on May 04, '05 11:33:48AM
Using the existing BIND and StartupItems.plist in 10.3.9 I recieved an error:
/System/Library/StartupItems/BIND/BIND: line 37: $1: unbound variable
However, using the stuff in the hint indicated for Tiger only fixed it. The connection does indeed seem faster, though I've had some strange connections lately, and can't tell what's latency and host problems and what's on my Mac.

Since I'm doing a full backup-and-install-Tiger tonight, I figured this was worth the risk. Seems like a not-bad idea.

[ Reply to This | # ]

Works in 10.3.9 with modifications
Authored by: benlotto on May 04, '05 11:46:05AM
Using
/System/Library/StartupItems/BIND/BIND start
does the trick and starts named as desired.

[ Reply to This | # ]
Works in 10.3.9 with modifications
Authored by: rnelson on May 18, '05 09:26:45PM

I got the same error in 10.3.9 -- call with with an argument of 'start'

/System/Library/StartupItems/BIND/BIND start



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: monickels on May 04, '05 11:38:50AM
Anyone who has 'switched' to the Mac, or has experience on a PC, knows that the PC makes the Mac look like a dog when it comes to web browsing. This is true for all browsers on the Mac.

This is a subjective statement unsupported by my own anecdotal evidence. I have Mac and Windows computers both at home and at work and I find the browsing "speed" (the rate at which data appears, the length of time it takes for a page to finish) to be indistinguishable.

[ Reply to This | # ]

Speed internet browsing via a local domain name server
Authored by: ms_t_rie on May 04, '05 12:39:16PM

I agree, my browsing speed on my Mac tends to be considerably FASTER than the browsing speed on my husband's PC. Both of us are using Firefox, so it's not a difference in browsers. (IMO, Safari is much slower than Firefox) With both of us going through the same router to the internet, the connection speed isn't the factor either, although having a fast connection could make the DNS lookup from being noticeable.

Browsing in a Virtual PC on the Mac is VERY slow, but that's probably due to the slowness of Virtual PC more than anything else. But my husband's PC is a high-end game system, it has PLENTY of power, more than 3x what my Mac has. It annoys him sometimes when I can browse faster than he can to the same sites :)



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: Anonymous on May 04, '05 04:34:28PM

Indeed.

It's often good advice to run a local caching resolver, but folks with simple networks (i.e., one or two boxes connected to a router, or one machine connected directly to the modem [of whatever kind]) will not necessarily see any drastic change in web browsing even with a local nameserver running on their clients.

For example, most Mozilla based browsers _already_ cache lookups, as does every Java app (that uses the network.) I don't know if Safari does or not, but it seems likely.

This is as true for Macs as it is other types of workstations. Wintel boxes are not naturally better at this.

If you have a real internal network (i.e., a bunch of boxes NATted behind a firewall, with some given static IPs and others dynamic, all on an actual domain) you are certainly advised to have a primary nameserver that caches lookups it gets from the outside world.

However, people who just "plug 'n play" to their provider with only a few little grey or blue boxes between them and the internet will not necessarily find this hint all that helpful.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: califone on May 04, '05 05:08:04PM

For us guys who use old skool G3's, Pentium II's blow us out of the water when it comes to browsing.

D/L files is a snap on broadband, but pages load hella slow (even with half a gig of ram).



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: ClarkGoble on May 04, '05 07:43:36PM

I think browsing with Firefox on both my Mac and my PC the Mac is faster. With Safari it was definitely slower until the 10.3.9 or 10.4 upgrades. Now Safari is only slightly slower than Firefox.



[ Reply to This | # ]
Agreed
Authored by: lullabud on May 05, '05 12:33:37PM

At work I have two Mac's and Two windows systems on my desktop, at my fingertips, which I use for network testing all day long every day. I don't find that browsing the internet on a Mac is any slower than in Windows, and actually, the ease at which you can provide additional DNS servers in Mac makes it even quicker when there are DNS slow-downs caused by the DHCP issued servers.

Making a blanket statement like that in the first line of a hint is a little out of line.



[ Reply to This | # ]
not needed. dns is already cached?
Authored by: redjar on May 04, '05 11:50:06AM

I'm pretty sure this is completely unneccessary. Mac OS X has a built-in caching deamon called lookupd. It caches DNS lookups so that the external DNS server doesn't need to be queried every time.

check out the man page: man lookupd

It makes troubleshooting tricky sometimes. To flush the cache you can do: lookupd -flushcache



[ Reply to This | # ]
not needed. dns is already cached?
Authored by: tferraro on May 04, '05 11:36:50PM
I was having frustrating Safari slowdowns over the last few days. Spinning beachball, etc. I tried lookupd -flushcache, and it's back to snappy. Thanks.

[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: metiure on May 04, '05 12:01:49PM

How can I undo this hint, if anything goes wrong?

Vic



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: Anonymous on May 04, '05 02:07:49PM

I applied this hint and found my internet connection to be slower. To remove it, I simply did the opposite of what it said:
removed what I had pasted (forwards...) and change DSNSERVER back to no on startup. I restarted and now my connection is back to the speed I had before applying this "hint".



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: jdtangney on May 05, '05 12:50:52AM

To undo, change the -YES- to -NO- in /etc/hostconfig.
--johnt



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: cynikal on May 04, '05 12:02:15PM

"... We are having to make every single request to an external DNS server, thus creating a lag in initial response."

This is simply not true, we do NOT have to make 'every single request'. It only looks it up once, the first look up if it's not in our cache.. then the system caches that for a certain amount of time (determined by the authoritative dns server's TTL) using the lookupd daemon (read the man pages if you want more information). All requests to the website by name will use the lookup instead of making requests every single time.

Furthermore, this type of hint is irresponsible in that it causes extra, unnecessary load on the auhoritative name servers on the internet because that's the point of caching nameservers upstream, instead of every single computer running its own name service cache.

Also this behaviour of having to look up an address initially is no different than any other operating system, so i'm not sure where do you get off calling windows vs mac web browsing dog slow? Like the other post mentioned, this is pretty subjective. Maybe it's time to upgrade your mac? Try using a slow windows machine and the tables will be turned.



[ Reply to This | # ]
Irresponsible? I don't think so...
Authored by: j-beda on May 04, '05 12:16:00PM
Furthermore, this type of hint is irresponsible in that it causes extra, unnecessary load on the auhoritative name servers on the internet because that's the point of caching nameservers upstream, instead of every single computer running its own name service cache.

I thought that the directions given made use of your ISP's (caching) DNS servers rather than going directly to the "root" authoritative servers. Thus if the ISP has it cached, you would get that info. Otherwise, what was the point of editing the files to include the ISP's DNS addresses?

[ Reply to This | # ]

Irresponsible? I don't think so...
Authored by: cynikal on May 05, '05 09:16:39AM

i stand corrected, i didn't look too deeply into his instructions, just saw him starting up bind to be used locally.. but if you're still depending mostly on your isp's dns servers, then this hint is pretty useless since they're likely the weakest part of the lookup chain.

actually if you use a nat device's dns (a nat device meaning a dsl/cable modem or wireless router), you can speed your initial lookups up by telling the nat to use a faster dns server.. i'm on verizon's dsl and the default dns server was dog slow, but i did some looking around and found a way faster one that was less hops away too.



[ Reply to This | # ]
launchd
Authored by: pascalpp on May 04, '05 12:02:48PM

does this hint take into the account the presence of launchd on Tiger?



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: sigma8 on May 04, '05 01:28:41PM

Hopefully this hint is not needed due to internal DNS caching that has been mentioned a few times. I started to set it up, but when when I got to the point where I needed to enter my DNS servers I stopped, as I'm on a laptop, and my DNS servers change several times a day.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: Jay on May 04, '05 10:48:22PM

I'm not totally qualified to answer this, but I don't think changing your location matters. Those DNS servers are still available on the internet, as long as you have a connection.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: jeremyp on May 05, '05 05:06:35AM

You might be behind a firewall that blocks outbound DNS requests except from the internal DNS server.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: dreness on May 04, '05 02:21:51PM

1) Mac OS X uses lookupd to cache all sorts of query results, including DNS results. The second time you request a web page, your mac will not initiate DNS requests that it did the first time. This is observable with tcpdump.

2) The main difference in web browsing speed between mac and windows has less to do with available bandwidth or other network conditions and more to do with the operating systems and applications themselves. I think DirectX is just flat-out faster, pound for pound, than quartz. Of course, it also doens't have the same feature set as Quartz... not even close, afaik.

You would do well to validate the assumptions on which any prospective 'tip' are based before going to all this trouble. Given Mac OS X's array of diagnostic tools, there's really no excuse not to...

There are general benefits to running a caching name server for your local network, just be sure that it's configured to FORWARD requests to its parent name servers, and not search the roots itself. In this situation, you will have a shared DNS cache for all machines on your network that would span reboots of any or all of your hosts. Most home routers already do this.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: autarkeia on May 04, '05 03:40:57PM
Windows doesn't use DirectX for its main GUI-drawing functions (yet, anyway... Longhorn will be a very different story). It uses GDI. There's a very good review of Longhorn's graphics architecture at Extremetech. But yes, it's safe to assume that GDI is probably faster than Quartz, but this is rather like saying that QuickDraw under OS9 is faster as well. They are very different beasts.

[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: ronaldo1 on May 04, '05 02:38:38PM
Before you do this, you all may want to check this article about IE and how it makes connections seem faster. http://grotto11.com/blog/slash.html

[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: jasont on May 04, '05 05:24:22PM

I just don't see how that's relevant to this hint. The sequence on that page doesn't apply to dns. It describes what happens after anything this hint would effect. There may or may not be some validity to using a local cache, and this hint might be useful for that...but it definitely gets people to take another look at bind...which means someone will make the wipeout pure hack for a mac easy.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: jeremyp on May 05, '05 05:04:18AM

a) they might do the same with the DNS server as with IIS.

b) the apparent speed of IE might not be due to DNS at all.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: bloodycelt on May 04, '05 05:18:26PM

Try this hint for Tiger DNS:
http://www.dan.co.jp/cases/macosx/tiger/bind-tiger.html
it seems a bit easier as Tiger DNS is using launchd

Though at the end when it gives the launchctl commands I had to use the full path of the file and the .plist extension for 'launchctl load' command.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: danielj7 on May 04, '05 06:12:30PM

It's actually even easier than that. There's no need to edit the /System/Library/LaunchDaemons/org.isc.named.plist file at all, just use

sudo launchctl load -w /System/Library/LaunchDaemons/org.isc.named
sudo launchctl start org.isc.named

to enable named, and

sudo launchctl stop org.isc.named
sudo launchctl unload -w /System/Library/LaunchDaemons/org.isc.named

to disable it. The "-w" flag tells launchctl to write the disabled status (true or false) back to the plist file.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: danielj7 on May 04, '05 06:16:43PM

Ack! There needs to be a .plist at the end of /System/Library/LaunchDaemons/org.isc.named of course.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: iJeff on May 04, '05 07:06:50PM

Not a good idea. I applied this hint and my Web browsing slowed down by an order of magnitude. I am using a router with broadband. This hint has been backed out of and dumped.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: Netzach on May 05, '05 06:55:21AM

Me to.
My connection got dog slow with the correct DNS servers...

---
//Intelligence has it's boundaries, but stupidity is unlimited.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: mkennard20 on May 04, '05 07:12:51PM

I've used this before
http://mail.computertree.com/~josh/simple/
DNS Helper.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: macboyrules on May 04, '05 07:34:44PM

Wow! That worked out great. Thanks!



[ Reply to This | # ]
In Tiger you should use launchd
Authored by: atverd on May 04, '05 07:53:11PM

Regarding starting named up on in Tiger...
Just edit /System/Library/LaunchDaemons/org.isc.named.plist as root and replace <true/> with <false/> in key Disabled. This will launch named automatically at every reboot.

---cut---
<key>Disabled</key>
<false/>
---cut---



[ Reply to This | # ]
Resulted in dramatically *slower* browsing
Authored by: sjonke on May 04, '05 10:21:53PM

For me, anyway. After applying this hack (I also had to do the Tiger-specific instructions on my Panther to get it to work), internet browsing was much, much slower, not faster at all. YMMV, but for me this sure was a bust and a half! Web sites too much longer to even start appearing, and while I think subsequent visits didn't take so long to start appearing, they did not in any way shape or form appear any faster than before the hack. Needless to say, I reverted everything back to its original state and rebooted. Faster browsing resulted!

---
--- What?



[ Reply to This | # ]
How to speed up Bind?
Authored by: hoagy on May 05, '05 02:21:33AM

I need to run BIND on my home network and I've found that BIND hosted on OS X is much slower than it was on an older PC running Redhat 8. Any ideas on how to speed up BIND on OS X?



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: jeremyp on May 05, '05 05:16:20AM

Whether this hint works depends entirely on the infrastructure of your ISP. If your ISP has good fast name servers with good connectivity to you, there is no chance you'll get better performance from this hint since their name servers will have the DNS requests of every one of their customers cached, thus you may get the benefits of caching even on your first visit to a site if somebody has been there already.

The other problem with this hint is that it breaks the ability to get a DNS server from DHCP so it should probably never be used with a laptop.



[ Reply to This | # ]
Wrong cure
Authored by: jmz on May 05, '05 05:34:59AM

As far as I know it's not the caching, it's Apples implmentation of IPv6. It will sometimes crash the DNS of the ISP. So to speed up your surfing, just disable IPv6 addressing in network.
It' that simple and worked for all mny customers.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: paperwings on May 05, '05 10:37:21AM

Not to contribute to the "he says" "she says" bit of this debate, but I have to agree with the hint author regarding browsing speed. I have a new powerbook and a 1.5 year old pc, and using the same dialup service (via my university) browsing using safari on the powerbook is much slower. Twice as slow on some pages, using both Panther and Tiger.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: paperwings on May 05, '05 10:37:21AM

Not to contribute to the "he says" "she says" bit of this debate, but I have to agree with the hint author regarding browsing speed. I have a new powerbook and a 1.5 year old pc, and using the same dialup service (via my university) browsing using safari on the powerbook is much slower. Twice as slow on some pages, using both Panther and Tiger.



[ Reply to This | # ]
Possibly the wrong solution
Authored by: TipMeOver on May 05, '05 11:00:10AM

I'm not an expert on this or anything but I was having the same problem on my Mac too. I figured it had to be the DNS server causing the problem because it took forever to connect to the site, but once it did, it would download the whole page very fast (unless the page referenced another domain for a graphic or something). Then after that the page would load quickly unless i waited a long time, then it would do it again. So I figured it cached it locally for a certain time and then it you didn't use it for a while, it would drop it from the cache.

This was a problem with all browsers and i was able to reproduce it with ping as well. I figured it must have been a problem with the ISP's domain server because it wasn't a problem all along, but just started happening all of a sudden. So the big suprise came when i tried it on my PC and it wasn't slow at all. (it had a good 10-20 second delay on my mac)

So I searched the net and was having trouble finding anything on this problem but I did find a thread somewhere in which someone had the problem come and go in certain builds of OSX and found that when he was having the problem in a particular build, he could fix it by just specifying the IP of the DNS server to use. I tried it and it worked perfectly.

Apparently, the problem is an intermittent bug in OSX where it doesn't properly retrieve the DNS server automatically when you are using DHCP to autodetect the DNS server from the ISP. My guess is that it gets an invalid address, tries it first, times-out, and then tries the secondary DNS server which works.

I have Verizon DSL, as did the other people I read about that had the problem. If you have verizon, you can go to verizon's web site and find the IP of the DNS server to use in your state. I'm sure other ISP's will provide this info as well.

You just have to get the IP address and go to the TCP/IP settings and specify the DNS server instead of having it auto detect.



[ Reply to This | # ]
Possibly the wrong solution
Authored by: foamy on May 05, '05 12:10:07PM

Same here with SBC DSL.

I noticed that all of a sudden lookups took forever and browsing was painful.

I called SBC and of course the woman in India had no idea what I was talking about, but she did find my local DNS IP addresses. Added those and it has worked fine ever since.



[ Reply to This | # ]
Don't forget to block ads!
Authored by: Thom on May 05, '05 02:00:16PM
Thought I should mention that it was this hint that reminded me, I'd been meaning to redo my 'hosts' file in order to block a bunch of ad servers. If your computer is skipping loading a bunch of ads from various sources, that would CERTAINLY speed up the load times of pages!

For example, I use a few sites whose ad servers are so overloaded that they hold up page loads, waiting for them to serve you an ad. What a crock!

Of course, to be fair to Rob, consider removing the 'backbeatmedia' entries. ;)

You can find a good article on it here.

On my machine, I turned on web sharing (apache) and I set up the 'catch-all' 404 error document to just return a simple 13 x 13 grey box I found on google image search. The web is a lot less busy for me now.

[ Reply to This | # ]

diagnostic command
Authored by: hayne on May 05, '05 02:03:47PM
Before even thinking about implementing this hint, you should find out exactly what it is that is slowing down your web browsing. Sometimes it is the DNS, but sometimes it is the server (nothing you can do about that), and sometimes it is the browser.

To eliminate the browser as a source of slowness, you can download the raw HTML via a command-line tool that does all the things that a browser does - except it doesn't display the page and so issues of graphics and rendering speed are factored out. The 'curl' program is one such command-line tool that you can use.

It turns out that 'curl' has some built-in diagnostics that are very useful for debugging web browsing troubles. The following command (copy & paste it into a Terminal window, and press Return) will show you the times taken for the various steps needed to retrieve a page from a given URL. This command is supposed to be all on one line but I have broken it up onto two lines to make it fit better on the page. You need to use the actual URL in place of "the_URL_of_the_web_page":


/usr/bin/curl the_URL_of_the_web_page -o /dev/null -w "dns: %{time_namelookup} connect: %{time_connect}
pretransfer: %{time_pretransfer} starttransfer: %{time_starttransfer} total: %{time_total}\n"
You could make this into a convenient one-word command as a Bash function by putting the following in your ~/.profile file (again this is broken into two lines but is supposed to be all on one line):

debug_http () { /usr/bin/curl $@ -o /dev/null -w "dns: %{time_namelookup} connect: %{time_connect}
pretransfer: %{time_pretransfer} starttransfer: %{time_starttransfer} total: %{time_total}\n" ; }
The first time reported is the time for the DNS query. If that time is small, then this hint definitely won't be of help.

[ Reply to This | # ]
DANGER!
Authored by: samkass on May 07, '05 08:43:24PM

This hint appears to open you up to some pretty serious security problems. I did this hint when it was posted. Today I realized that "www.google.com" was being hijacked and sent to an alternate site via my local BIND DNS lookup (every lookup for "www.google.com" was being sent to "www.google.com.net", but since it's at the DNS level, Safari still showed www.google.com in the address bar.) Resetting it to use my cable modem company's ISP reset it to the correct google site. I've since undone the hack and all is well again.

I'm not enough of an expert on DNS to know what the vulnerability's specific issues are, but based on my experience this hint is a VERY BAD idea.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: John Strung on May 10, '05 08:03:46PM

I had done something similar with an earlier version of OS X, but one of the updates broke it, so I was pleased to find this hint. It has made a tremendous improvement for me. Before following this hint, I was have problems with any browser pausing for 1 to 3 seconds while the status bar said "resolving..." or "looking up...". This was clearly a DNS problem and has been well documented in the Apple Discussion forums. None of the suggested solutions, i.e. manually adding the DNS IP's or turning off IPV6 worked.

Setting up the caching DNS as per the instructions here cleared the problem entirely. My browser now goes straight to every page with no "resolving..." hesitation at all.

Having said that, I did not find implementing the hint all that easy and at first, due to errors I made, the resolution problem actually got worse. I suspect that is what happened with the posters who complained that this hint made matters worse.

In particular, I had a bit of trouble with the syntax of the named.conf file, but I found that the console log would report syntax errors on reboot and after a few tries I was able to get it right.

Incidentally, I am behind a router (DLink 614+) and had the slow resolution problem nonetheless.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: name99 on May 24, '05 05:53:33AM

To add to all the other comments here, the value of this tip seems somewhat variable.
In the old days (early 10.3) I did the equivalent of this tip and was pleasantly surprised at the speedboost. But on my current machines (10.3.9 and 10.4.1) it noticeably slows things down. In both cases the network hardware (Airport Extreme base station) has not changed.

I suspect the resolution of this is that there might have been a bug of some sort in early 10.3.x where, although DNS values should have been cached locally automatically (ie without running a local DNS server), this was not happening, and that this bug was fixed at some point in the 10.3.x series. Anyway the bottom line is that, at least for my situation:
(1) Airport base station caches DNS entries and does so efficiently, so even if local caching doesn't work the trip to the base station is extremely rapid.
(2) Empirically running the local caching DNS server is not a win on 10.3.9 and 10.4.1 with Airport Extreme.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: pwbjmv on May 31, '05 02:36:42AM

Had to chime in here. Since updating to Tiger I've had the most horribly slow lookups (timeouts all the time). I went to a friends house with my 12" PBook who had the same cable provider I did (which was slow as hell in my house) and we compared sites. His wepages (on PC) would load instantly while I would wallow in DNS hell on Mac side... for some unknown reason. Tried the IPV6 fix.. nothing. Tired entering manual IPs instead of DHCP... nothing. Tried entering DNS servers manually... nothing. Applied this hack and.... POW... surfing at the same speed as my friend on his PC now. So... regardless of right or wrong, correct or not.. this "hack" has definitely helped me out in a HUGE way.

Really makes me wonder though what the hell is going on with Apple's DNS stuff.... this hack seems to work for some and ruin others connections... strange.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: boothefox on Dec 01, '05 11:36:43AM

Worked on iBookG4 Tiger 10.4.3

Thank you so much ! Finally i can work and nothing irritates me... :)



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: dirtymouse on Jan 11, '06 05:31:09AM

Works beautifully for me:

some possible trip ups that may have been causing problems for others:

[1]


"

Add the following into the options section...

forwarders {
x.x.x.x;
x.x.x.x;
};

"

>> i was thinking this was wrong and put it in separately, but that caused an error and i re-read those instructions, the end result should actually look like this (sans any comments):

options {
directory "/var/named";

forwarders {
x.x.x.x;
x.x.x.x;

};

// query-source address * port 53;
};



[2]

DNSSERVER=-YES-.

should be DNSSERVER=-YES-






---
Author of "fix a troubled Mac'
(A Macintosh Troubleshooting PDF book)



[ Reply to This | # ]
DNS Caching - tip worked great 10.4.4
Authored by: danger359 on Feb 07, '06 05:00:46PM

I have a LAN in my house behind a Linksys router and cable modem. I have been using an old Mac PPC running 9.2 and a program called "MacDNS" to provide local DNS caching for computers at home (wired and wireless). It worked great for years, but now I've had to put the old PPC down. RIP.

I tried this hint on another Mac I use for a server, running 10.4.4. Set up all the other computers network preferences to go to this server for DNS. Works like a charm, much faster although the initial query to an obscure web site might take a bit. The second query goes like a flash.

I have tried simply using my ISP's DNS servers, but the ping time to them ranged from 10msec on a good day to nearly 100msc on a bad day. Local caching levels this out.

Bottom line: follow the directions, careful typing, don't do anything dumb, and it works. As always, YMMV
Thanks.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: regulus on Apr 25, '06 09:17:07AM

Wow, drastic improvement is right! Thanks so much, it worked perfectly. I'm not sure what others are talking about saying this won't make a difference. It sure does! Commenters are saying you won't see much difference the first time you visit a website, but that's when I see the biggest improvement. I did a few tests using 2 Macs side-by-side, one with this fix and one without, and was getting almost a 40% speed improvement in page loading time on the first visit to websites. That's huge.



[ Reply to This | # ]
You Hub is the Culprit
Authored by: zmorris on Apr 29, '06 12:52:16PM

I was able to fix my DNS problem by going into my D-Link DI-624 802.11g wireless hub. Its DNS was set to 0.0.0.0, I entered the first two DNS from this list, these are level 3 DNS servers which will remove the uncertainty of your ISP's DNS being the problem:

4.2.2.1
4.2.2.2
4.2.2.3
4.2.2.4
4.2.2.5
4.2.2.6

For some reason my Macs were falling back to the DNS of the hub, even when I entered different numbers in the Mac. I believe the hub might be hijacking the lookups. I have written a full report in this thread on the macnetworkprog mailing list:

http://lists.apple.com/archives/macnetworkprog/2006/Apr/msg00085.html

Here is the start of the thread, with suggestions from others:

http://lists.apple.com/archives/macnetworkprog/2005/Nov/msg00073.html

A few more details: my hub is connected to an Actiontec GT701-WG wireless router that I have not needed to set DNS entries for. That possibly points to the d-link as the culprit. Qwest is my ISP here in Boise ID, and I have 1500/750 DSL. I see the problem even when booting in safe mode. I was getting this problem in 10.4.6 on my flat panel iMac G4 700 and I also saw this problem in 10.3.9 on my white iBook G3 700.

I have filed a bug report with Apple, ID 4531762, please reference that if you decide to file bug reports of your own. This will hopefully press Apple to include a diagnostic tool in the Network system pref pane to detect DNS timeouts, or fix the bug if it is their fault.

I believe that using BIND may work around the problem, because BIND may be able to access other DNS servers independently of the hub. So BIND might still be a possibility if you are in an office and don't have access to the hub. I have not tried using it though.



[ Reply to This | # ]
Your Hub is the Culprit
Authored by: zmorris on Apr 29, '06 12:59:08PM

I was able to fix my DNS problem by going into my D-Link DI-624 802.11g wireless hub. Its DNS was set to 0.0.0.0, I entered the first two DNS from this list, these are level 3 DNS servers which will remove the uncertainty of your ISP's DNS being the problem:

4.2.2.1
4.2.2.2
4.2.2.3
4.2.2.4
4.2.2.5
4.2.2.6

For some reason my Macs were falling back to the DNS of the hub, even when I entered different numbers in the Mac. I believe the hub might be hijacking the lookups. I have written a full report in this thread on the macnetworkprog mailing list:

http://lists.apple.com/archives/macnetworkprog/2006/Apr/msg00085.html

Here is the start of the thread, with suggestions from others:

http://lists.apple.com/archives/macnetworkprog/2005/Nov/msg00073.html

A few more details: my hub is connected to an Actiontec GT701-WG wireless router that I have not needed to set DNS entries for. That possibly points to the d-link as the culprit. Qwest is my ISP here in Boise ID, and I have 1500/750 DSL. I see the problem even when booting in safe mode. I was getting this problem in 10.4.6 on my flat panel iMac G4 700 and I also saw this problem in 10.3.9 on my white iBook G3 700.

I have filed a bug report with Apple, ID 4531762, please reference that if you decide to file bug reports of your own. This will hopefully press Apple to include a diagnostic tool in the Network system pref pane to detect DNS timeouts, or fix the bug if it is their fault.

I believe that using BIND may work around the problem, because BIND may be able to access other DNS servers independently of the hub. So BIND might still be a possibility if you are in an office and don't have access to the hub. I have not tried using it though.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: waltr on Sep 13, '06 04:09:34PM
hello,

i've written an AppleScript that automates most of this hint. it includes an uninstaller, so you can easily back out of this.

the code is posted here:

http://bbs.applescript.net/viewtopic.php?id=18422

enjoy (or not)! and use at your own risk.

[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: tmhackalot on Sep 23, '06 05:27:34PM

This is an excelent post.

I have been searching for quite awhile trying to figure out what was going on with my mac. I was just about to enable local DNS when I saw the post in here about the DNS servers being incorrect. I checked it out and bingo!

It was pretty imbarassing that my daughter insisted on using my old 400 Mhz Windows 98 computer because it was 'faster' than my iMac.

I had narrowed down the problem to lookupd, but never even thought about a problem with DHCP and the DNS servers. I would like to know why it was using bad servers, but that is for another day.

I'm perfectly happy with performance now. It could be that local DNS caching would improve things even further but I am concerned about how to deal with my VPN.

Thanks again people!



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: John Strung on Oct 22, '06 12:38:10PM

This tip is great, but I think there are a couple of typos and ambiguities in section 3. Perhaps the author can comment.

In particular, there should be no # sign in the line
#!/bin/sh

The author should also make it clear that the line:

$ touch StartupParameters.plist; pico -w StartupParameters.plist

is to be typed into terminal and is not part of the text to be typed into the Pico editor. Also, the $ sign should be a # sign.

Similarly, the author should make it clear that the line

$ chmod +x BIND

is to be typed into terminal, and not into the Pico editor and the $ sign should be a # sign.

If the author agrees with my comments, I wonder if the original hint could not be cleaned up as I suspect people for whom this hint did not work were misled by the typos above.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: kindall on Oct 22, '06 03:20:03PM
<I>In particular, there should be no # sign in the line #!/bin/sh</I>

Of course there should be. It's a shebang.

http://en.wikipedia.org/wiki/Shebang_(Unix)

[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: rdiiorio on Feb 13, '07 10:14:12AM

I had the same problem , win xp(gateway 2GHZ) and osx(macmini 1.5ghz G4) both on the same cable modem and router network, the win giving 5+Mbps compared to the mac showing 1.3Mbps. I used the same speed test (aroundcinci.com) on both. I am on the roadrunner cable service in NYC.

What I did was after reading every post here was to go into my router and i manually entered values for the DNS, 4.2.2.1, 4.2.2.2 etc.

I opened the network TCP/IP pref pane in my macmini(running Tiger 10.4.8) and entered the same DNS # in the DNS Servers field.

Now my Mac is reporting 5.71~6.0Mbps download speed compared to my Win box 5.74Mbps. The speeds reported are using Safari(5.71Mbps), Netscape(5.99Mbps) and Firefox(5.8Mbps) all 3 browsers OPEN concurrent.

Hope this tip works as well for others as it did for me.



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: rdiiorio on Feb 13, '07 10:22:16AM

Sorry i forgot to mention in the prior post, I also DISABLED IPv6 in the mac mini



[ Reply to This | # ]
Speed internet browsing via a local domain name server
Authored by: scottsasonic on Jun 12, '07 07:57:05PM

Looks like zmorris is the one to go with here, check his links to the apple info also.

The thing is, in my case, it wasn't imparative to enter 2 of the following
DNS in only the router (in my case a wired Linksys BEFSR41)
for the 'fix' to be effective. My first try was to put the 2 of the new DNS numbers:
4.2.2.1
4.2.2.2
4.2.2.3
4.2.2.4
4.2.2.5
4.2.2.6

in the network preference DNS servers box. This fixed my computers very slow (sometimes bordering on 20 seconds, sometimes timing right out)
to load content immediately upon hitting the APPLY NOW button.
Now as mentioned, people found this isolated with just Safari, but it was with any web browser for me, and also with my Hotline and KDX server to load.
I use a G4 400 mhz sawtooth, and have never experienced this lag before, was absolutely maddening. BUt ever since I moved, and changed service providers (i used to be on bell sympatico DSL, now on Rogers Cable high speed) about a month and a half ago it's been a plague. Made no sense either as my house mate who was connected in on his PC was getting no lag, and also my trusty power PC 9600 running os 9.2.2 was the FASTEST connection in the house.

I initially had our network running through a single Linksys WRT54GS
wireless router. I hardwired into it, as I don't have wireless card, and
my housemate used his PC laptop wireless to connect.
Problems with my connection from day one. I couldn't understand it as i was directly wired in.
SO..i thought it was because the wireless functionality of the router was
interfering with my connection.
I took out my Linksys BEFSR41 from the box it was stored in and
made this the first Router in the chain after the Modem. I connected to this, and then connected the WRT54GS to port 2 on the BEFSR41.
Good to go, for about half an hour.

Keeping this configuration, I proceeded to try other hardware possibilities..
After trying a different ethernet pci card, and trying the built in ethernet in the sawtooth for a while and occassionally trying different settings in the router, this DNS info here at mac os x hints googled it's way onto my screen.

Thank god for this information. DO NOT try some of the more elaborate schemes posted,(as they seem to open up some security issues) try this one first as it will probably fix your issues, if your problems sound similar.

I did end up putting the DNS numbers into my router settings also, just to be sure, and it's been 3 days now and no lag or problems, just easy surfing like it should be. IN contrast with easy surfing for about 10minutes after a reboot, then hard times. Impossible to list on ebay that way I tell you! Curiously, it never affected my messenger (adium) functions.

Interesting to note also about how people just complain about Safari, when I had it affect everything except for adium. I don't totally understand the DSN thing, but I have a hunch in my case it's provider dependant (rogers cable with the bad DNS numbers ) as like i said, i've used Bell here in ontario canada with no issues, and Telus in Vancouver(that was the fastest connection ever)

My sawtooth is now happily doing it's thing like it should be, don't need a G5 to have top download speeds! :D

Rogers Cable ontario canada
Linksys BEFSR41
os : 10.4.8
sawtooth G4-400
pci ethernet card
384 mb ram



[ Reply to This | # ]