Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Hello, I am trying to set up a DNS for my LAN using Ubuntu server 12.04 (32-bit) Output from /usr/sbin/named -v is BIND 9.8.1-P1 This is the content of named.conf.local: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    18

    Bind 9.8.1-P1 problem


    Hello,

    I am trying to set up a DNS for my LAN using Ubuntu server 12.04 (32-bit)

    Output from /usr/sbin/named -v is BIND 9.8.1-P1

    This is the content of named.conf.local:

    zone "vitronix.lan" {
    type master;
    file "/etc/bind/db.vitronix.lan.";
    };

    zone "10.168.192.in-addr.arpa" {
    type master;
    notify no;
    file "etc/bind/db.10.168.192";
    };

    // Consider adding the 1918 zones here, if they are not used in your
    // organization
    // include "/etc/bind/zones.rfc1918";

    Content of db.vitronix.lan:

    ;
    ; BIND data file for local loopback interface
    ;
    $TTL 604800
    at IN SOA virtual.vitronix.lan. root.vitronix.lan. (
    2 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800 ) ; Negative Cache TTL
    ;
    at IN NS virtual.vitronix.lan.
    virtual IN A 192.168.10.36
    at IN AAAA ::1

    Content of db.10.168.192:

    ;
    ; BIND reverse data file for local loopback interface
    ;
    $TTL 604800
    at IN SOA virtual.vitronix.lan. root.vitronix.lan. (
    1 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800 ) ; Negative Cache TTL
    ;
    at IN NS virtual.
    36 IN PTR virtual.vitronix.lan.

    Output of dig vitronix.lan is:

    ; <<>> DiG 9.8.1-P1 <<>> vitronix.lan
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 29900
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;vitronix.lan. IN A

    ;; Query time: 3 msec
    ;; SERVER: 192.168.10.36#53(192.168.10.36)
    ;; WHEN: Sun Apr 7 06:54:58 2013
    ;; MSG SIZE rcvd: 30

    I wasn't alowed to use the at sing so I replaced it with at.

    I have installed Apache2, and when I enter 192.168.10.36 I get

    It works..etc

    But I want to enter virtual.vitronix.lan

    Can anyone help?

    Tanks in advance.

  2. #2
    Just Joined!
    Join Date
    Dec 2009
    Location
    California
    Posts
    98
    I think you are confusing BIND with Apache.

    For virtual hosts to work, you MUST use the host name in the URL of your browser, not the IP address.

    A cursory look at you bind setup looks good. Make sure the host where you are running the browser is pointed to the host where you've configured BIND for resolution (first nameserver record in resolv.conf if it's unix), then fire up the browser and type in http://virtual.vitronix.lan in the URL.

    If you want to take bind out of the mix, you can add virtual.vitronix.lan to the hosts file on the machine where you are running the browser in order to test.

    The way virtual hosts work, is the browser passes along the url in the http request and the web server (apache, in this case), looks at the contents and does a match.

    If this still doesn't work, I would think the problem is the virtual hosts stanzas in your httpd.conf... If you search through my posts here at linuxquestions, you will see that I previously gave an example of setting up virtual hosts in apache.

  3. #3
    Just Joined!
    Join Date
    Jul 2012
    Posts
    18

    BIND9 doesn't work

    Quote Originally Posted by vitronix View Post
    Hello,

    I am trying to set up a DNS for my LAN using Ubuntu server 12.04 (32-bit)

    Code:
    Output from /usr/sbin/named -v is BIND 9.8.1-P1
    
    This is the content of named.conf.local:
    
    zone "vitronix.lan" {
            type master;
            file "/etc/bind/db.vitronix.lan.";
            };
    
    zone "10.168.192.in-addr.arpa" {
            type master;
            notify no;
            file "etc/bind/db.10.168.192";
            };
    
    // Consider adding the 1918 zones here, if they are not used in your
    // organization
    // include "/etc/bind/zones.rfc1918";
    
    Content of db.vitronix.lan:
    
    ;
    ; BIND data file for local loopback interface
    ;
    $TTL    604800
    at       IN      SOA     virtual.vitronix.lan. root.vitronix.lan. (
                                  2         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
    at       IN      NS      virtual.vitronix.lan.
    virtual IN      A       192.168.10.36
    at       IN      AAAA    ::1
    
    Content of db.10.168.192:
    
    ;
    ; BIND reverse data file for local loopback interface
    ;
    $TTL    604800
    at       IN      SOA     virtual.vitronix.lan. root.vitronix.lan. (
                                  1         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
    at       IN      NS      virtual.
    36      IN      PTR     virtual.vitronix.lan.
    
    Output of dig vitronix.lan is:
    
    ; <<>> DiG 9.8.1-P1 <<>> vitronix.lan
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 29900
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;vitronix.lan.                  IN      A
    
    ;; Query time: 3 msec
    ;; SERVER: 192.168.10.36#53(192.168.10.36)
    ;; WHEN: Sun Apr  7 06:54:58 2013
    ;; MSG SIZE  rcvd: 30
    I wasn't alowed to use the at sing so I replaced it with at.

    I have installed Apache2, and when I enter 192.168.10.36 I get

    It works..etc

    But I want to enter virtual.vitronix.l

    Can anyone help?

    Tanks in advance.
    I have done the complete configuration using the Ubuntu serverguide


    contents of named.conf.local:

    Code:
    zone "vitronix.lan" {
            type master;
            file "/etc/bind/db.vitronix.lan";
            };
    
    zone "10.168.192.in-addr.arpa" {
            type master;
            notify no;
            file "/etc/bind/db.10.168.192";
    };
    contents of db.vitronix.lan:
    Code:
    ;
    ; BIND data file for local loopback interface
    ;
    $TTL    604800
    @       IN      SOA     ns.vitronix.lan. (
                         2013041100         ; Serial
                                604800         ; Refresh
                                  86400         ; Retry
                              2419200         ; Expire
                                604800 )       ; Negative Cache TTL
    ;
    @       IN      NS      ns.vitronix.lan.
    @       IN      A       192.168.10.36
    ns      IN      A       192.168.10.36
    Contents of db.10.168.192:
    Code:
    ;
    ; BIND reverse data file for local loopback interface
    ;
    $TTL    604800
    @       IN      SOA     ns.vitronix.lan. (
                         2013041100         ; Serial
                                604800         ; Refresh
                                  86400         ; Retry
                              2419200         ; Expire
                                604800 )       ; Negative Cache TTL
    ;
    @       IN      NS      ns.
    36      IN      PTR     ns.vitronix.lan.
    Output of dig vitronix.lan:

    Code:
    ; <<>> DiG 9.8.1-P1 <<>> vitronix.lan
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 20895
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;vitronix.lan.                  IN      A
    
    ;; Query time: 4 msec
    ;; SERVER: 192.168.10.36#53(192.168.10.36)
    ;; WHEN: Thu Apr 11 03:09:01 2013
    ;; MSG SIZE  rcvd: 30
    now when i run

    Code:
    host -l 192.168.10.36
    Host 36.10.168.192.in-addr.arpa not found: 2(SERVFAIL)

    After adding 192.168.10.254 (my firewall) to the dns-nameservers I get this

    Code:
    host -l 192.168.10.36
    Host 36.10.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
    Hope anyone can help, I am getting frustraded
    Last edited by vitronix; 04-14-2013 at 09:32 AM. Reason: typo's

  4. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    It has been a while since I had to work with DNS but it looks like you are missing the origin tag from your zone file

    Code:
    $ORIGIN example.com.
    Code:
    ;
    ; BIND reverse data file for local loopback interface
    ;
    $TTL    604800
    $ORIGIN vitronix.lan.
    @       IN      SOA     ns.vitronix.lan. (
                         2013041100         ; Serial
                                604800         ; Refresh
                                  86400         ; Retry
                              2419200         ; Expire
                                604800 )       ; Negative Cache TTL
    ;
    @       IN      NS      ns.
    36      IN      PTR     ns.vitronix.lan.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  5. #5
    Just Joined!
    Join Date
    Jul 2012
    Posts
    18
    Quote Originally Posted by Lazydog View Post
    It has been a while since I had to work with DNS but it looks like you are missing the origin tag from your zone file

    Code:
    $ORIGIN example.com.
    Code:
    ;
    ; BIND reverse data file for local loopback interface
    ;
    $TTL    604800
    $ORIGIN vitronix.lan.
    @       IN      SOA     ns.vitronix.lan. (
                         2013041100         ; Serial
                                604800         ; Refresh
                                  86400         ; Retry
                              2419200         ; Expire
                                604800 )       ; Negative Cache TTL
    ;
    @       IN      NS      ns.
    36      IN      PTR     ns.vitronix.lan.
    That didn't work I still get the message

    Code:
    root@virtual:/etc/bind# host -l 192.168.10.36
    Host 36.10.168.192.in-addr.arpa not found: 2(SERVFAIL)

  6. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    what is the output for the following command;

    Code:
    ps -aux | grep named

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  7. #7
    Just Joined!
    Join Date
    Jul 2012
    Posts
    18

    Solved

    Quote Originally Posted by Lazydog View Post
    what is the output for the following command;

    Code:
    ps -aux | grep named
    Thanks Lazydog but I solved the problem myself.
    There where two thing wrong, trail and error solved the first problem (not having root.vitronix.lan. in my files) second fault was not having a PTR record in my files. I figured that out by running named-checkzone.

    Here's the right configuration:

    contents of named.conf.local:
    Code:
    zone "vitronix.lan" {
            type master;
            file "/etc/bind/db.vitronix.lan";
    };
    
    zone "10.168.192.in-addr.arpa" {
            type master;
            notify no;
            file "/etc/bind/db.10.168.192";
    };
    
    // Consider adding the 1918 zones here, if they are not used in your
    // organization
    // include "/etc/bind/zones.rfc1918";
    contents of named.conf.options:

    Code:
    options {
            directory "/var/cache/bind";
    
            forwarders {
                    192.168.10.254;
            };
    
         
            dnssec-validation auto;
    
            auth-nxdomain no;    # conform to RFC1035
            listen-on-v6 { any; };
    };
    contents of db.vitronix.lan:

    Code:
    ;
    ; BIND reverse data file for local loopback interface
    ;
    $TTL    604800
    at       IN      SOA     ns.vitronix.lan. root.vitronix.lan. (
                         2013041502         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
    at       IN      NS      ns.vitronix.lan.
    ns      IN      A       192.168.10.36
    box     IN      A       192.168.10.36
    contents od db.10.168.192:

    Code:
    ;
    ; BIND reverse data file for local loopback interface
    ;
    $TTL    604800
    at       IN      SOA     ns.vitronix.lan. root.vitronix.lan. (
                         2013041502         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
    at       IN      NS      ns.
    36      IN      PTR     ns.vitronix.lan.
    36      IN      PTR     box.vitronix.lan.
    I can now run
    Code:
    root#virtual:/etc/bind# host -l vitronix.lan
    vitronix.lan name server ns.vitronix.lan.
    ns.vitronix.lan has address 192.168.10.36
    box.vitronix.lan has address 192.168.10.36
    and
    Code:
    root#virtual:/etc/bind# named-checkzone vitronix.lan db.vitronix.lan
    zone vitronix.lan/IN: loaded serial 2013041502
    OK
    I actualy got www instead of box but I am not allowed to submit that

    What I don't understand is why I have to add root.vitronix.lan. in my files.

    I want to test using CNAME and MX fields and will post the result if anybody is interested.

    I'm new to this kind of communication so excuse me if the layout is wrong.

    Thank's again everybody for yor time.
    Last edited by vitronix; 04-16-2013 at 05:24 PM. Reason: Errors

  8. #8
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    I see another error in your files. While it is OK to have multiple hosts pointing to one ip address the same is not true for the reverse zone.
    There should be a 1-to-1 ratio in this file. You have two record for the 36 address when there should only be one.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  9. #9
    Just Joined!
    Join Date
    Jul 2012
    Posts
    18

    Added CNAME

    Quote Originally Posted by Lazydog View Post
    I see another error in your files. While it is OK to have multiple hosts pointing to one ip address the same is not true for the reverse zone.
    There should be a 1-to-1 ratio in this file. You have two record for the 36 address when there should only be one.
    You are right I altered my files the following way:

    db.vitronix.lan:

    Code:
    ; BIND reverse data file for local loopback interface
    ;
    $TTL    604800
    @       IN      SOA     ns.vitronix.lan. root.vitronix.lan. (
                         2013041502         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
    @       IN      NS      ns.vitronix.lan.
    ns      IN      A       192.168.10.36
    www     IN      CNAME   ns
    db.10.168.192:

    Code:
    ;
    ; BIND reverse data file for local loopback interface
    ;
    $TTL    604800
    @       IN      SOA     ns.vitronix.lan. root.vitronix.lan. (
                         2013041502         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
    @       IN      NS      ns.
    36      IN      PTR     ns.vitronix.lan.
    I think I have done it the right way now, there is one thing that puzzle's me thoug: why must I have root.vitronix.lan in both files?

  10. #10
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Quote Originally Posted by vitronix View Post
    I think I have done it the right way now, there is one thing that puzzle's me thoug: why must I have root.vitronix.lan in both files?
    This is for the email address. You can have what you want in there it doesn't have to be root.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Page 1 of 2 1 2 LastLast

Posting Permissions

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