Page 1 of 16 12311 ... LastLast
Results 1 to 10 of 153

Thread: Howto: Setup a DNS server with bind

  1. #1
    Join Date
    Mar 2006
    Location
    Dublin, Ireland
    Beans
    13
    Distro
    Ubuntu 6.06

    Howto: Setup a DNS server with bind

    After looking on Ubuntu forum for an easy step-by-step howto for instaling a DNS server, I decided the best idea would probably be to write this howto myself.... So, here it is!

    Step 1: Install Ubuntu dapper, or use your WORKING installation.

    Step2: Install bind 9:
    Code:
    sudo apt-get install bind9
    Step 3: Configure the main Bind files. Usually, if you install Bind from the source code, you will have to edit the file named.conf. However, Ubuntu provides you with a pre-configured Bind, so we will edit another file:
    Code:
    sudo vi /etc/bind/named.conf.local
    This is where we will insert our zones. By the way, a zone is a domain name that is referenced in the DNS server
    Insert this in the named.conf.local file:
    Code:
    # This is the zone definition. replace example.com with your domain name
    zone "example.com" {
            type master;
            file "/etc/bind/zones/example.com.db";
            };
    
    # This is the zone definition for reverse DNS. replace 0.168.192 with your network address in reverse notation - e.g my network address is 192.168.0
    zone "0.168.192.in-addr.arpa" {
         type master;
         file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
    };
    Ok, now, let's edit the options file:
    Code:
    sudo vi /etc/bind/named.conf.options
    We need to modify the forwarder. This is the DNS server to which your own DNS will forward the requests he cannot process.
    Code:
    forwarders {
          # Replace the address below with the address of your provider's DNS server
          123.123.123.123;
    };
    Now, let's add the zone definition files (replace example.com with your domain name:
    Code:
    sudo mkdir /etc/bind/zones
    sudo vi /etc/bind/zones/example.com.db
    The zone definition file is where we will put all the addresses / machine names that our DNS server will know. You can take the following example:
    Code:
    // replace example.com with your domain name. do not forget the . after the domain name!
    // Also, replace ns1 with the name of your DNS server
    example.com.      IN      SOA     ns1.example.com. admin.example.com. (
    // Do not modify the following lines!
                                                            2006081401
                                                            28800
                                                            3600
                                                            604800
                                                            38400
     )
    
    // Replace the following line as necessary:
    // ns1 = DNS Server name
    // mta = mail server name
    // example.com = domain name
    example.com.      IN      NS              ns1.example.com.
    example.com.      IN      MX     10       mta.example.com.
    
    // Replace the IP address with the right IP addresses.
    www              IN      A       192.168.0.2
    mta              IN      A       192.168.0.3
    ns1              IN      A       192.168.0.1
    Now, let's create the reverse DNS zone file:
    Code:
    sudo vi /etc/bind/zones/rev.0.168.192.in-addr.arpa
    Copy and paste the following text, modify as needed:
    Code:
    //replace example.com with yoour domain name, ns1 with your DNS server name.
    // The number before IN PTR example.com is the machine address of the DNS server. in my case, it's 1, as my IP address is 192.168.0.1.
    @ IN SOA ns1.example.com. admin.example.com. (
                            2006081401;
                            28800; 
                            604800;
                            604800;
                            86400 
    )
    
                         IN    NS     ns1.example.com.
    1                    IN    PTR    example.com
    Ok, now you just need to restart bind:
    Code:
    sudo /etc/init.d/bind9 restart
    We can now test the new DNS server...
    Step 4: Modify the file resolv.conf with the following settings:
    Code:
    sudo vi /etc/resolv.conf
    enter the following:
    Code:
    // replace example.com with your domain name, and 192.168.0.1 with the address of your new DNS server.
    search example.com
    nameserver 192.168.0.1
    Now, test your DNS:
    Code:
    dig example.com
    Look at the result.... Enjoy!
    Also, this post is not perfect... Do not hesitate to improve it!
    Last edited by tomtom_in_eire; August 15th, 2006 at 08:38 AM.

  2. #2
    Join Date
    Aug 2006
    Beans
    40

    Re: Howto: Setup a DNS server with bind

    I have setup my hp xg833, 733mhz and 384megs ram, just as you have above. I have even cut and pasted through putty. I have then set one of my other machines to go to the dns server to only have it say not able to reach the website I want to reach. Basically I am using the dns server for the intranet and the internet. I thought that once it did not find what I was looking for on the intranet it would go to the ISP, which I have set the ip addresses and host, on to the internet. Is this thinking correct? I am stumped.
    Thanks larka06
    email at larka51@netscape.net
    I also can meet you on the IRC channel or anywhere you want me to be

  3. #3
    Join Date
    Jul 2006
    Location
    Jackson, MS
    Beans
    37
    Distro
    Gutsy Gibbon Testing

    Re: Howto: Setup a DNS server with bind

    One more step to get it to work:
    You must rename the named.conf.local to named.conf

  4. #4
    Join Date
    Jun 2006
    Beans
    37

    Re: Howto: Setup a DNS server with bind

    Nice tutorial , i was working with this and with a tutorial that is in this page http://www.aboutdebian.com/dns.htm

    The thing its that im not sure if a did everything well, i dont know how to test this..

    y dig mekas.com and this says the terminal:

    dantec@ubuntu:~$ dig mekas.com

    ; <<>> DiG 9.3.2 <<>> mekas.com
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 9469
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;mekas.com. IN A

    ;; Query time: 12 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Mon Sep 18 00:42:30 2006
    ;; MSG SIZE rcvd: 27



    if i dig something wrong, i get this:

    dantec@ubuntu:~$ dig tadeo.meks.com

    ; <<>> DiG 9.3.2 <<>> tadeo.meks.com
    ;; global options: printcmd
    ;; connection timed out; no servers could be reached


    I think its working, but i need to be sure, please i will apreciate if u help me, im kind of newbie in linux and i need to mount a dns server 4 a class ;)

    THX a lot

    Regards

    MeKaS

  5. #5
    Join Date
    Aug 2006
    Beans
    3

    Re: Howto: Setup a DNS server with bind

    When I try and install bnd9, here is what I get..Any ideas ?

    sudo apt-get install bind9
    Reading package lists... Done
    Building dependency tree... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.

    Since you only requested a single operation it is extremely likely that
    the package is simply not installable and a bug report against
    that package should be filed.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    bind9: Depends: libdns21 (= 1:9.3.2-2ubuntu1) but 1:9.3.2-2ubuntu1.1 is to be installed
    Depends: libisccfg1 (= 1:9.3.2-2ubuntu1) but 1:9.3.2-2ubuntu1.1 is to be installed
    Depends: libisc11 (= 1:9.3.2-2ubuntu1) but 1:9.3.2-2ubuntu1.1 is to be installed
    Depends: libisccc0 (= 1:9.3.2-2ubuntu1) but 1:9.3.2-2ubuntu1.1 is to be installed

  6. #6
    Join Date
    Mar 2006
    Location
    Slovenija
    Beans
    260
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Howto: Setup a DNS server with bind

    must domain be registered or not?
    Can i use no-ip.com domain?

    I am using router so which port must o foward for bind server?

    www IN A 192.168.1.5
    mta IN A 192.168.1.5
    ns1 IN A 192.168.1.5

    can i use for all three the same ip and the same machine?
    Juventus the champion

  7. #7
    Join Date
    Oct 2006
    Location
    Sweden
    Beans
    12
    Distro
    Ubuntu 5.10

    Re: Howto: Setup a DNS server with bind

    I also had trouble installing bind9, so I tried to write:

    apt-get install bind

    and that gave me version 8.4.6-1. I'm sure this will suffice for my simple home network.

  8. #8
    Join Date
    Feb 2006
    Beans
    20
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Howto: Setup a DNS server with bind

    Thanks for the tutorial. I have a dynu account and used this as my domain name. I believe dynu is similar to no-ip.com. I installed bind9 with synaptic in edgy, and followed your directions. Works without a problem.

  9. #9
    Join Date
    Dec 2005
    Location
    Philly PA, USA
    Beans
    90
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Howto: Setup a DNS server with bind

    Does this work for Edgy?

    I would like to set up a "chrooted" bind server for local traffic and Internet forwarding. Would this tutorial work?

    I was trying to follow on howtoforge.com regarding "A perfect setup" for Edgy 6.10 server, but ran into trouble when I came to setting up bind9. I understand DNS, just not bind.

    Thx

    /J
    I'm tryin...

  10. #10
    Join Date
    Nov 2006
    Location
    Prague
    Beans
    1
    Distro
    Kubuntu 6.06 Dapper

    Smile Re: Howto: Setup a DNS server with bind

    Finaly, what I was looking for.
    Thanks a lot.

Page 1 of 16 12311 ... LastLast

Bookmarks

Posting Permissions

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