Perfect setup Debian Etch ISPConfig - DNS Server

Discussion in 'Installation/Configuration' started by kdclaver, Dec 12, 2007.

  1. kdclaver

    kdclaver New Member

    Hello Falko,
    I have just installed the DNS server as described in step 9. Unfortunately the command "host-a debian" gives me this (see below):
    debian:~# host -a debian
    Trying "debian.dpi-arobasetelecom.ci"
    Trying "debian"
    Host debian not found: 3(NXDOMAIN)
    Received 99 bytes from 192.168.2.1#53 in 0 ms
    debian:~# host -a debian.dpi-arobasetelecom.ci
    Trying "debian.dpi-arobasetelecom.ci"
    Host debian.dpi-arobasetelecom.ci not found: 2(SERVFAIL)
    Received 46 bytes from 192.168.2.1#53 in 0 ms
    debian:~#

    How do I settle the problem or what command replaces "host-a debian" for permit me to know that my DNS works.

    Thanks more for your concern

    PS: These are the configuration informations :
    debian:~# hostname
    debian.dpi-arobasetelecom.ci
    debian:~# hostname -f
    debian.dpi-arobasetelecom.ci
    debian:~#

    named.conf.local

    zone "dpi-arobasetelecom.ci" {
    type master;
    file "/var/lib/named/var/cache/bind/db.dpi";
    };

    zone "2.168.192.in-addr.arpa" {
    type master;
    file "/var/lib/named/var/cache/bind/db.192";
    };

    resolv.conf

    # generated by NetworkManager, do not edit!
    search dpi-arobasetelecom.ci
    nameserver 192.168.2.1

    db.dpi

    ;
    ; BIND data file for local loopback interface
    ;
    $TTL 604800
    @ IN SOA debian.dpi-arobasetelecom.ci. root.dpi-arobasetelecom.ci. (
    2007121201 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800 ) ; Negative Cache TTL
    ;
    @ IN NS debian.dpi-arobasetelecom.ci.
    @ IN MX 10 mail.dpi-arobasetelecom.ci.

    debian IN A 192.168.2.1

    mail IN CNAME debian
    www IN CNAME debian
    ftp IN CNAME debian
    sql IN CNAME debian
    crm IN CNAME debian
    wkg IN CNAME debian


    db.192
    ;
    ; BIND data file for local loopback interface
    ;
    $TTL 604800
    @ IN SOA debian.dpi-arobasetelecom.ci. root.dpi-arobasetelecom.ci. (
    2007121201 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800 ) ; Negative Cache TTL
    ;
    @ IN NS debian.dpi-arobasetelecom.ci.

    1 IN PTR debian.dpi-arobasetelecom.ci.
     
  2. kdclaver

    kdclaver New Member

    Hello,
    Trying to find a solution I look the syslog. Here I finf these messages (below)

    Dec 13 14:15:42 debian named[14733]: zone 2.168.192.in-addr.arpa/IN: loading master file /var/lib/named/var/cache/bind/db.192: file not found
    Dec 13 14:15:42 debian named[14733]: zone 255.in-addr.arpa/IN: loaded serial 1
    Dec 13 14:15:42 debian named[14733]: zone dpi-arobasetelecom.ci/IN: loading master file /var/lib/named/var/cache/bind/db.dpi: file not found
    Dec 13 14:15:42 debian named[14733]: zone localhost/IN: loaded serial 1

    The files are present in the directory, I don't understand the origin of this message as you can see
    debian:~# cd /var/lib/named/var/cache/bind/
    debian:/var/lib/named/var/cache/bind# ls -l
    total 8
    -rw-r--r-- 1 bind bind 343 2007-12-12 14:21 db.192
    -rw-r--r-- 1 bind bind 489 2007-12-12 14:24 db.dpi
    debian:/var/lib/named/var/cache/bind#

    I want to tell that I can't finalize the installation of ISPConfig because it can't access to www.dpi-arobasetelecom.ci. The ping command gives this result :
    debian:/var/lib/named/var/cache/bind# ping www.dpi-arobasetelecom.ci
    ping: unknown host www.dpi-arobasetelecom.ci
    debian:/var/lib/named/var/cache/bind#



    Thanks more for your help
     
  3. falko

    falko Super Moderator Howtoforge Staff

    Are you sure you set up BIND exactly as shown in the tutorial? Might be a chroot problem.
     
  4. kdclaver

    kdclaver New Member

    Hello Falko,
    I've installed Bind as it's described in the howto. I agree with you that it can be a chroot problem.
    How can I help you to help me solve this problem ?

    Thanks for your feedback.
     
  5. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -la /var/lib/named
    ?
     
  6. kdclaver

    kdclaver New Member

    Below is the output
    debian:~# ls -la /var/lib/named
    total 20
    drwxr-xr-x 5 root root 4096 2007-12-12 13:55 .
    drwxr-xr-x 49 root root 4096 2007-12-13 11:10 ..
    drwxr-xr-x 2 root root 4096 2007-12-18 06:25 dev
    drwxr-xr-x 3 root root 4096 2007-12-12 13:56 etc
    drwxr-xr-x 4 root root 4096 2007-12-12 13:55 var
    debian:~#

    Thanks more for your help !!!!!
     
  7. falko

    falko Super Moderator Howtoforge Staff

    Looks ok. Can you also post the output of
    Code:
    ls -la /var/lib/named/var
    ?
     
  8. kdclaver

    kdclaver New Member

    Hello Falko,
    Below the output of ls -la /var/lib/named/var
    debian:~# ls -la /var/lib/named/var
    total 16
    drwxr-xr-x 4 root root 4096 2007-12-12 13:55 .
    drwxr-xr-x 5 root root 4096 2007-12-12 13:55 ..
    drwxr-xr-x 3 bind bind 4096 2007-12-12 13:55 cache
    drwxr-xr-x 3 bind bind 4096 2007-12-12 13:55 run
    debian:~#

    Thanks more again
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Can you try this?

    Code:
    mkdir -p /var/lib/named/etc
    mkdir /var/lib/named/dev
    mkdir -p /var/lib/named/var/cache/bind
    mkdir -p /var/lib/named/var/run/bind/run
    mv /etc/bind /var/lib/named/etc
    ln -s /var/lib/named/etc/bind /etc/bind
    mknod /var/lib/named/dev/null c 1 3
    mknod /var/lib/named/dev/random c 1 8
    chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
    chown -R bind:bind /var/lib/named/var/*
    chown -R bind:bind /var/lib/named/etc/bind
     
  10. kdclaver

    kdclaver New Member

    Hello Falko,
    I've tried the command as you indicate, below the outputs :
    debian:~# mkdir -p /var/lib/named/etc
    debian:~# mkdir /var/lib/named/dev
    mkdir: ne peut créer le répertoire `/var/lib/named/dev': Le fichier existe.

    debian:~# mkdir -p /var/lib/named/var/cache/bind
    debian:~# mkdir -p /var/lib/named/var/run/bind/run
    debian:~# mv /etc/bind /var/lib/named/etc
    mv: `/etc/bind' et `/var/lib/named/etc/bind' identifient le même fichier.

    debian:~# ln -s /var/lib/named/etc/bind /etc/bind
    debian:~# mknod /var/lib/named/dev/null c 1 3
    mknod: `/var/lib/named/dev/null': Le fichier existe.
    debian:~# mknod /var/lib/named/dev/random c 1 8
    mknod: `/var/lib/named/dev/random': Le fichier existe.

    debian:~# chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
    debian:~# chown -R bind:bind /var/lib/named/var/*
    debian:~# chown -R bind:bind /var/lib/named/etc/bind
    debian:~#

    In bold you can see the message which indicate that the files or the directory exist.

    Thanks more
     
  11. falko

    falko Super Moderator Howtoforge Staff

    Can you try this?
    Code:
    mkdir -p /var/lib/named/var/lib/named
    cd /var/lib/named/var/lib/named
    ln -s ../../../ var
     
  12. kdclaver

    kdclaver New Member

    Hello Falko,
    I want you to apologize for the delayed response. I had no access to my server. It is set now. Here are the results (below):

    debian:~# mkdir -p /var/lib/named/var/lib/named
    debian:~# cd /var/lib/named/var/lib/named/
    debian:/var/lib/named/var/lib/named# ln -s ../../../ var
    debian:/var/lib/named/var/lib/named#
    debian:/var/lib/named/var/lib/named# /etc/init.d/bind9 restart
    Stopping domain name service...: bind.
    Starting domain name service...: bind.
    debian:/var/lib/named/var/lib/named#

    ------- @ --------

    debian:/var/lib/named/var/lib/named# host -a debian
    Trying "debian.dpi-arobasetelecom.ci"
    Trying "debian"
    ;; connection timed out; no servers could be reached
    debian:/var/lib/named/var/lib/named# host -a debian.dpi-arobasetelecom.ci
    Trying "debian.dpi-arobasetelecom.ci"
    Host debian.dpi-arobasetelecom.ci not found: 2(SERVFAIL)
    Received 46 bytes from 192.168.2.1#53 in 0 ms
    debian:/var/lib/named/var/lib/named#

    As you can see there is no error in the execution of commands. Unfortunately DNS always seems not to turn.

    Thanks more for your help
     
  13. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    netstat -tap
    ? Any errors in /var/log/syslog?
     
  14. kdclaver

    kdclaver New Member

    Hello Falko,
    below the outputs of netstat -tap and /var/log/syslog

    debian:~# netstat -tap
    Connexions Internet actives (serveurs et établies)
    Proto Recv-Q Send-Q Adresse locale Adresse distante Etat PID/Program name
    tcp 0 0 localhost.localdom:2208 *:* LISTEN 2546/hpiod
    tcp 0 0 localhost.localdo:mysql *:* LISTEN 2634/mysqld
    tcp 0 0 *:sunrpc *:* LISTEN 2217/portmap
    tcp 0 0 *:auth *:* LISTEN 2906/inetd
    tcp 0 0 localhost.localdo:60433 *:* LISTEN 2549/python
    tcp 0 0 *:ftp *:* LISTEN 3120/proftpd: (acce
    tcp 0 0 debian.dpi-aroba:domain *:* LISTEN 2503/named
    tcp 0 0 localhost.locald:domain *:* LISTEN 2503/named
    tcp 0 0 *:43831 *:* LISTEN 3063/rpc.statd
    tcp 0 0 localhost.localdoma:ipp *:* LISTEN 2820/cupsd
    tcp 0 0 *:smtp *:* LISTEN 2968/master
    tcp 0 0 localhost.localdoma:953 *:* LISTEN 2503/named
    tcp 0 0 debian.dpi-arobas:35874 80.231.19.73:www ESTABLISHED3386/firefox-bin
    tcp 0 0 debian.dpi-arobas:35873 80.231.19.73:www ESTABLISHED3386/firefox-bin
    tcp 0 0 debian.dpi-arobas:33799 ik-in-f17.google.co:www ESTABLISHED3386/firefox-bin
    tcp 0 0 debian.dpi-arobas:50295 www.howtoforge.com:www TIME_WAIT -
    tcp 0 0 debian.dpi-arobas:50303 www.howtoforge.com:www TIME_WAIT -
    tcp 0 0 debian.dpi-arobas:50302 www.howtoforge.com:www TIME_WAIT -
    tcp 0 0 debian.dpi-arobas:50306 www.howtoforge.com:www TIME_WAIT -
    tcp 0 0 debian.dpi-arobas:50312 www.howtoforge.com:www TIME_WAIT -
    tcp 0 0 debian.dpi-arobas:56181 213.200.111.145:www ESTABLISHED3386/firefox-bin
    tcp 0 0 debian.dpi-arobas:45254 b2.data.vip.re2.yah:www TIME_WAIT -
    tcp6 0 0 *:imaps *:* LISTEN 2778/couriertcpd
    tcp6 0 0 *:pop3s *:* LISTEN 2797/couriertcpd
    tcp6 0 0 *:pop3 *:* LISTEN 2783/couriertcpd
    tcp6 0 0 *:imap2 *:* LISTEN 2766/couriertcpd
    tcp6 0 0 *:www *:* LISTEN 3168/apache2
    tcp6 0 0 *:domain *:* LISTEN 2503/named
    tcp6 0 0 *:ssh *:* LISTEN 2997/sshd
    tcp6 0 0 *:smtp *:* LISTEN 2968/master
    tcp6 0 0 ip6-localhost:953 *:* LISTEN 2503/named
    tcp6 0 0 *:https *:* LISTEN 3168/apache2


    debian:~# tail -f /var/log/syslog
    Dec 26 07:30:01 debian anacron[3955]: Anacron 2.3 started on 2007-12-26
    Dec 26 07:30:01 debian anacron[3955]: Normal exit (0 jobs run)
    Dec 26 07:38:26 debian ntpd[3087]: no servers reachable
    Dec 26 07:39:01 debian /USR/SBIN/CRON[4179]: (root) CMD ( [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -r -0 rm)
    Dec 26 07:49:09 debian ntpd[3087]: synchronized to 196.25.1.1, stratum 2
    Dec 26 08:03:52 debian postfix/qmgr[2985]: 073D25A691: from=<>, size=2430, nrcpt=1 (queue active)
    Dec 26 08:03:52 debian postfix/smtp[4800]: 073D25A691: to=<[email protected]>, relay=none, delay=174203, delays=174203/0.29/0.03/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=debian.dpi-arobasetelecom.ci type=MX: Host not found, try again)
    Dec 26 08:09:01 debian /USR/SBIN/CRON[4931]: (root) CMD ( [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -r -0 rm)
    Dec 26 08:17:01 debian /USR/SBIN/CRON[5136]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
    Dec 26 08:33:41 debian -- MARK --

    As you can see there is no error concerning bind9 in syslog.

    Thanks more for your help
     
  15. falko

    falko Super Moderator Howtoforge Staff

    Bind seems to be running ok. Did you create a record for debian.dpi-arobasetelecom.ci?
    Can you try
    Code:
    dig @localhost debian.dpi-arobasetelecom.ci
    ?
     
  16. kdclaver

    kdclaver New Member

    Hello Falko,
    These are the output and the content of the differents configuration files.

    debian:~# dig @localhost debian.dpi-arobasetelecom.ci

    ; <<>> DiG 9.3.4 <<>> @localhost debian.dpi-arobasetelecom.ci
    ; (1 server found)
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 4689
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;debian.dpi-arobasetelecom.ci. IN A

    ;; Query time: 25 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Wed Dec 26 19:45:35 2007
    ;; MSG SIZE rcvd: 46

    debian:~# cat /etc/bind/named.conf.local
    //
    // Do any local configuration here
    //
    zone "dpi-arobasetelecom.ci" {
    type master;
    file "/var/lib/named/var/cache/bind/db.dpi";
    };

    zone "2.168.192.in-addr.arpa" {
    type master;
    file "/var/lib/named/var/cache/bind/db.192";
    };
    // Consider adding the 1918 zones here, if they are not used in your
    // organization
    //include "/etc/bind/zones.rfc1918";

    debian:~#
    debian:~# cat /var/lib/named/var/cache/bind/db.dpi
    ;
    ; BIND data file for local loopback interface
    ;
    $TTL 604800
    @ IN SOA debian.dpi-arobasetelecom.ci. root.dpi-arobasetelecom.ci. (
    2007121201 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800 ) ; Negative Cache TTL
    ;
    @ IN NS debian.dpi-arobasetelecom.ci.
    @ IN MX 10 mail.dpi-arobasetelecom.ci.

    debian IN A 192.168.2.1

    mail IN CNAME debian
    www IN CNAME debian
    ftp IN CNAME debian
    sql IN CNAME debian
    crm IN CNAME debian
    wkg IN CNAME debian
    debian:~#
    debian:~# cat /var/lib/named/var/cache/bind/db.192
    ;
    ; BIND data file for local loopback interface
    ;
    $TTL 604800
    @ IN SOA debian.dpi-arobasetelecom.ci. root.dpi-arobasetelecom.ci. (
    2007121201 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800 ) ; Negative Cache TTL
    ;
    @ IN NS debian.dpi-arobasetelecom.ci.

    1 IN PTR debian.dpi-arobasetelecom.ci.
    debian:~#

    Thanks more for your help.
     
  17. falko

    falko Super Moderator Howtoforge Staff

    Looks ok... :confused:
     

Share This Page