Reduce Mac OS X query times by making a local cache on the computer
Register

We are the best invite forum on the internet! Here you will find free invites, free seedboxes, free bonuses, and much more. Our members know the true meaning of sharing and have created a truly global bittorent community! Our site has the most up to date information on all private trackers and our members will guide you and introduce you to this truly secretive and enlightened club. Ready to get started? Register now!


Results 1 to 1 of 1
Like Tree1Likes
  • 1 Post By alonmg

Thread: Reduce Mac OS X query times by making a local cache on the computer

  1. #1

    Join Date
    Sep 2011
    Location
    Dallas, Texas USA
    Posts
    50

    Default Reduce Mac OS X query times by making a local cache on the computer

    So I recently made a document detailing how to make an actual DNS caching server using Linux, and since Mac OS X and Linux are both Unix based, they are very similar. Mac OS X doesn't have a built in DNS cache, like winblows does. However by creating a caching server,or a local cache you can fix that, and have it cache even better than Winblows can.

    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 Text Edit will not execute properly as root.

    A few things to remember before we start...

    • Capitalization is important!
    • Terminal commands are shown in orange, and preceded by a # prompt character or a dollar sign $ (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) I use OpenDNS which is 208.67.222.222 and 208.67.220.220:
    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 or newer.

    # 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 or newer 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!
    Credit to http://hints.macworld.com/article.ph...50420025219402
    Last edited by alonmg; September 20th, 2011 at 07:13 AM. Reason: forgot to add where I got the site from.
    specialized likes this.


  2. To remove ads become VIP. Inquire about advertising here.

Similar Threads

  1. Reduce DNS query times to speed up browsing
    By alonmg in forum Internet
    Replies: 1
    Last Post: March 18th, 2012, 12:59 AM
  2. Replies: 5
    Last Post: August 11th, 2011, 12:36 AM
  3. How Does Ubuntu 9.04 Measure Up to Mac OS X?
    By BoomShankar in forum Computers
    Replies: 2
    Last Post: September 9th, 2009, 11:36 PM
  4. Best Mac OS X Bit Torrent Client
    By airman in forum BitTorrent Discussion
    Replies: 8
    Last Post: August 4th, 2009, 06:19 AM
  5. How To Burn or Copy Xbox 360 Games in Mac OS X ?
    By TorrentChamp in forum Operating Systems
    Replies: 4
    Last Post: July 29th, 2009, 05:48 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •