MagLite Solitaire Single AAA Cell Flashlight

The perfect technician's flashlight
Click Here!
: : : : : : : :    h o m e   :|:   A l l   i n   G e n e r a l   O u t d o o r s   :|:   M a g l i t e   S a l e s   :|:   m y   r e s u m e   
 L i n u x H e l p  : : : : : : : :

DNS/BIND the Easy Way(tm)

  • named.conf
  • Reverse zone file
  • Forward zone file
  • Testing your new config
  • It doesn't work! What can I do?

    In this tutorial, I will show you how to get name service running on a network with the following configuration:

    - Network: 192.168.10.0
    - Domain: home.lan
    - Hosts: ns1, foo, bar and baz

    - The PC's address are :
    • 192.168.10.1 - ns1.home.lan home.lan : Linux running BIND (named)
    • 192.168.10.2 - foo.home.lan
    • 192.168.10.3 - bar.home.lan
    • 192.168.10.4 - baz.home.lan
    This tutorial is written in a manner that will allow any monkey to copy and paste a few things and get a dns server running. (I was able to do it after all!). I would suggest using this tutorial along with some other documentation such as can be found at google.com.

    So let's do it!

    Warning : Be mindful of syntax, there are dots "." everywhere. Don't forget them!

    File : /etc/resolv.conf
    This tells the resolver to send queries to our name server
    search      home.lan
    nameserver  192.168.10.1
    
    File : /etc/named.conf
    This is where you tell named what zones to configure when it starts. We are defining a single forward and a reverse zone for our purposes
    zone "10.168.192.in-addr.arpa" {
      type master;
        file "zones/192.168.10.zone";
        };
    
        zone "home.lan" {
          type master;
            file "zones/home.lan.zone";
            };
    
    Create a file /var/named/zones/192.168.10.zone
    // 192.168.10.zone 
    
        10.168.192.in-addr.arpa.    IN  SOA    home.lan. root.home.lan. (
                            200210132    ;   Serial
                            10800        ;   Refresh 3 Hours
                            3600         ;   Retry 1 hour
                            604800       ;   Expire 7 days
                            3600 )       ;   Minimum 24 hours
           10.168.192.in-addr.arpa.    IN  NS  ns1.home.lan.
           1.10.168.192.in-addr.arpa.  IN  PTR ns1.home.lan.
           2.10.168.192.in-addr.arpa.  IN  PTR foo.home.lan.
           3.10.168.192.in-addr.arpa.  IN  PTR bar.home.lan.
           4.10.168.192.in-addr.arpa.  IN  PTR baz.home.lan.
    
    
    "root.home.lan" is the guy to contact, just in case it doesn't work ;-).

    Create a file /var/named/zones/home.lan.zone
    // home.lan.zone 
    
        home.lan.   IN  SOA     home.lan. root.home.lan. (
                      23		; serial
                      10800		; refresh
                      3600		; retry
                      604800	; expiration
                      86400 )	; minimum
               home.lan.   IN  NS  ns1.home.lan.
                 home.lan.        IN  A   192.168.10.1
                 ns1.home.lan.    IN  A   192.168.10.1
                 foo.home.lan.    IN  A   192.168.10.2
                 bar.home.lan.    IN  A   192.168.10.3
                 baz.home.lan.    IN  A   192.168.10.4
    
    Here you are! You have to restart /etc/rc.d/init.d/named, so that the modifications are applied.
    Check to see if it works:
             bash-2.04%   host 192.168.10.1
             1.10.168.192.in-addr.arpa domain name pointer ns1.home.lan.
             
             bash-2.04%   host foo.home.lan
             foo.home.lan has address 192.168.10.2
    
             bash-2.04%   host 192.168.10.3
             3.10.168.192.in-addr.arpa domain name pointer bar.home.lan.
    
             bash-2.04%
    
    To add other machines, you have to modify the following files:

    /var/named/zones/home.lan.zone
    /var/named/zones/192.168.10.zone

    This way, name resolution works forward and reverse.

    Help me! It doesn't work!

    There are a few things you can do to debug your configuration to see just what the heck you've done wrong. The first thing is to check the message log. (This is actually the first thing you should do for almost any problem you come across in Linux)
    [root@panic named]# tail -20 /var/log/messages
    Nov 27 17:28:06 panic named[29724]: starting BIND 9.2.0 -u named
    Nov 27 17:28:06 panic named[29726]: loading configuration from '/etc/named.conf'
    Nov 27 17:28:06 panic named[29726]: listening on IPv4 interface lo, 127.0.0.1#53
    Nov 27 17:28:06 panic named[29726]: listening on IPv4 interface eth0, 192.168.0.1#53
    Nov 27 17:28:06 panic named: named startup succeeded
    Nov 27 17:28:06 panic named[29726]: zone 0.0.127.in-addr.arpa/IN: loaded serial 200210132
    Nov 27 17:28:06 panic named[29726]: zone 0.168.192.in-addr.arpa/IN: loaded serial 200210132
    Nov 27 17:28:06 panic named[29726]: zone home.lan/IN: loaded serial 200210132
    Nov 27 17:28:06 panic named[29726]: zone localhost/IN: loaded serial 200210132
    Nov 27 17:28:06 panic named[29726]: running
    
    
    That is what a normal named startup looks like in /var/log/messages.

    There are also two commands that may be available on your system that are very helpful for debugging zone files and named.conf. They are:

    /usr/sbin/named-checkzone
    and
    /usr/sbin/named-checkconf


    I hope most of this makes sense ;-) Good luck!

    -Krnl

    Learn everything you ever wanted to know about DNS/Bind with one of these books from Amazon.com.

    cover    cover   cover
  •  L i n u x   W o r l d   N e w s   : : : : : : : :


    What in the hell is a KrnlPanic? Well, a KrnlPanic is me! Actually, let's start with "What is a kernel?". The kernel is the core of your operating system (OS), whether your OS is Linux, Unix or windows. The kernel takes care of all process management (what program runs and when), memory management (which parts of memory get used for what) and also, the kernel takes care of interfacing the OS with your computer's hardware (disk drives, sound card, modem, network card, etc).

    Now...since the kernel is doing all of these extremely important jobs, it stands to reason that if it has an error, it will be a Bad Thing(tm). If you use windows, you know a kernel panic as a "BSOD" or Blue Screen of Death. Or how about "Invalid Page Fault in KERNEL32.DLL". I'm sure you've probably seen both of those. In Linux, a Kernel Panic is normally plainly stated so. At boot time is when you will see most linux panics. I have yet to see a linux kernel panic while the system is running. You may have seen "Kernel Panic: init not found" or "Kernel Panic: VFS unable to mount root fs on 2:00". All of these previously listed errors are because of something that happened to the kernel that it couldn't handle, whether it was an access to an invalid memory location or the inability to find the initialization files it requires.

    I hope that sufficiently explains things. Oh yeah...KrnlPanic is also my name ;-)

    - Rick

     S l a s h d o t / F r e s h m e a t   : : : : : : : :
    Slashdot and Freshmeat Headlines at 1328382714 (Unixtime)

    Slashdot.org Home

    o Milky Way Magnetic Fields Charted
    o New Book Helps You Start Contributing To Open Source
    o $100,000 Prize: Prove Quantum Computers Impossible
    o President By Day, High-Tech Headhunter By Night
    o You Will Never Kill Piracy
    o New Mobile Plan Pools Data On Unlimited Devices
    o The Destruction of Iraq's Once-Great Universities
    o World's Largest Virtual Optical Telescope Created
    o Facebook On Collision Course With New EU Privacy Laws
    o Researchers Feel Pressure To Cite Superfluous Papers
    Freshmeat.net Home

    Freshmeat headlines seem to be having problems. Will get this working again soon.
     
    Search Slashdot:
    Search Freshmeat:
    Search for linux books or other merchandise @ Amazon.com

    Search:
    Keywords:
    In Association with Amazon.com

    Google
    : : : : : : : :  K r n l P a n i c   : : : : : : : :
    Disclaimer: The documents on this site are to be taken as-is, and I accept no responsibility for damages that may occur from errors or omissions in any of the documents on this site or referred to by this site. By using any of these help documents, you agree to this disclaimer.          ***This site best viewed at 1024x768 or better screen resolution.***