FedoraForum.org - Fedora Support Forums and Community
Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2010
    Location
    Greece
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Set up a caching-only nameserver using dnsmasq

    The following mini-HOWTO is taken from a guide about how to configure dnsmasq as a caching nameserver, written by George Notaras and published under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

    What is a caching nameserver?
    A caching nameserver is a DNS service that keeps a local cache of domain name to IP address mappings. Once the DNS information is cached, it is no longer needed to forward the queries to the upstream nameservers. This results in faster domain name resolution. This means that several tasks like web browsing or email processing by spam filters may get a little performance boost.

    Both desktops and servers may benefit from using a local caching nameserver.

    Why dnsmasq?
    It is mature, lightweight and does the job efficiently.

    Installation
    Install using yum:
    Code:
    yum install dnsmasq
    Configuration
    Save the following configuration file in /etc/dnsmasq.conf

    Code:
    #
    # Configuration file for dnsmasq acting as a caching nameserver.
    #
    # Format is one option per line, legal options are the same
    # as the long options legal on the command line. See
    # "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
    #
    # Updated versions of this configuration file may be available at:
    #
    #   http://www.g-loaded.eu/2010/09/18/caching-nameserver-using-dnsmasq/
    #
    
    #
    # Basic server configuration
    #
    
    listen-address=127.0.0.1
    port=53
    bind-interfaces
    user=dnsmasq
    group=dnsmasq
    pid-file=/var/run/dnsmasq.pid
    
    #
    # Logging
    #
    
    #log-facility=/var/log/dnsmasq.log
    #log-queries
    
    #
    # Name resolution options
    #
    
    domain-needed
    bogus-priv
    no-hosts
    dns-forward-max=150
    cache-size=1000
    #no-negcache
    neg-ttl=3600
    resolv-file=/etc/resolv.dnsmasq
    no-poll
    Save the list of the upstream nameservers in the file: /etc/resolv.dnsmasq
    The following IPs are used as an example. Use the IP addresses of your ISP's DNS servers.

    Code:
    nameserver 192.168.0.252
    nameserver 192.168.0.253
    nameserver 192.168.0.254
    Start the dnsmasq service:

    Code:
    /etc/init.d/dnsmasq start
    Make the system use the dnsmasq service for domain name resolution:

    Code:
    echo "nameserver 127.0.0.1" > /etc/resolv.conf
    Enjoy!

    For more details about the used directives plus some tips about logging to file, please read the full dnsmasq guide.
    Last edited by gnotaras; 3rd October 2010 at 08:58 AM. Reason: Fixed typo

Similar Threads

  1. caching nameserver update from today
    By kwhiskers in forum Using Fedora
    Replies: 0
    Last Post: 30th January 2007, 05:37 AM
  2. caching nameserver behind router not working
    By crick136 in forum Servers & Networking
    Replies: 8
    Last Post: 23rd March 2006, 10:32 PM

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
  •