Problem setting up DNS - Kindly help

Discussion in 'Server Operation' started by skirao, Aug 12, 2008.

  1. skirao

    skirao New Member

    Hello all,

    I am trying to setup DNS server on Ubuntu 8.04 - AMD64 for my intranet from http://www.howtoforge.com/installing...rver-with-bind and below is the error and configuration. Studio is my server name and the IP address is 10.10.10.4. I am wondering if the file names and the entries are correct. I also have a wins server, how can i configure DNS to get the hostnames from the WINS server instead of adding them manually?

    Contents of /etc/network/interfaces
    auto lo
    iface lo inet loopback
    # The primary network interface
    auto eth0
    iface eth0 inet static
    address 10.10.10.4
    netmask 255.255.255.0
    network 10.10.10.0
    broadcast 10.10.10.255

    Contents of /etc/hosts

    127.0.0.1 localhost.localdomain localhost

    10.10.10.4 studio.abc.org studio
    # The following lines are desirable for IPv6 capable hosts
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts

    Contents of /etc/default/bind9

    OPTIONS="-u bind -t /var/lib/named"
    # Set RESOLVCONF=no to not run resolvconf
    RESOLVCONF=yes

    Contents of /etc/bind/named.conf

    zone "abc.org" {
    type master;
    file "/etc/bind/zones/abc.org.db";
    };

    zone "10.10.10.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/rev.10.10.10.in-addr.arpa";
    };

    key "rndc-key" {
    algorithm hmac-md5;
    secret "9WNiBNj5fFyBWUxfR88nAQ==";
    };

    controls {
    inet 127.0.0.1 port 953
    allow { 127.0.0.1; } keys { "rndc-key"; };
    };

    Contents of /etc/bind/named.conf.options. I don't have any other DNS servers in my network so i have commented all the entries except below.

    forwarders {
    123.123.123.123;
    };

    Contents of /etc/bind/zones/rev.10.10.10.in-addr.arpa

    @ IN SOA studio.abc.org. root (
    2006081401;
    28800;
    604800;
    604800;
    86400
    )
    IN NS studio.abc.org.
    4 IN PTR abc.org

    Contents of /etc/bind/zones/abc.org.db

    abc.org. IN SOA studio.abc.org. root (

    // 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

    abc.org. IN NS studio.abc.org.
    //abc.org. IN MX 10 mta.abc.org. - Dont have a mail server

    // Replace the IP address with the right IP addresses.
    studio IN A 10.10.10.4


    /etc/init.d/bind9 restart

    root@studio:/etc/bind# /etc/init.d/bind9 restart
    * Stopping domain name service... bind rndc: connect failed: 127.0.0.1#953: connection refused
    [fail]
    * Starting domain name service... bind usage: named [-4|-6] [-c conffile] [-d debuglevel] [-f|-g] [-n number_of_cpus]
    [-p port] [-s] [-t chrootdir] [-u username]
    [-m {usage|trace|record|size|mctx}]
    named: extra command line arguments
    [fail]


    Kindly help
     
    Last edited: Aug 12, 2008
  2. chipsafts

    chipsafts New Member

    Check your firewall settings.

    Also, it might help to list the contents of /etc/init.d/bind9
     
  3. skirao

    skirao New Member

    I don't have any firewall configured in my network. I am setting up this DNS Server for my intranet. I have a squid proxy server running to access the internet and i have not configured firewall. I have a DHCP server running on another Linux Server that runs Squid and LTSP. Do you see any problem with this.
     
  4. skirao

    skirao New Member

    contents of /etc/init.d/bind9

    #!/bin/sh

    ### BEGIN INIT INFO
    # Provides: bind9
    # Required-Start: $remote_fs
    # Required-Stop: $remote_fs
    # Should-Start: $network $syslog
    # Should-Stop: $network $syslog
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Start and stop bind9
    # Description: bind9 is a Domain Name Server (DNS)
    # which translates ip addresses to and from internet names
    ### END INIT INFO

    PATH=/sbin:/bin:/usr/sbin:/usr/bin

    # for a chrooted server: "-u bind -t /var/lib/named"
    # Don't modify this line, change or create /etc/default/bind9.
    OPTIONS=""
    RESOLVCONF=yes

    test -f /etc/default/bind9 && . /etc/default/bind9

    test -x /usr/sbin/rndc || exit 0

    . /lib/lsb/init-functions
    DISTRO=$(lsb_release -is 2>/dev/null || echo Debian)

    check_network() {
    if [ -z "$(/sbin/ifconfig)" ]; then
    #log_action_msg "No networks configured."
    return 1
    fi
    return 0
    }

    case "$1" in
    start)
    log_daemon_msg "Starting domain name service..." "bind"

    modprobe capability >/dev/null 2>&1 || true

    # dirs under /var/run can go away on reboots.
    mkdir -p /var/run/bind/run
    chmod 775 /var/run/bind/run
    chown root:bind /var/run/bind/run >/dev/null 2>&1 || true

    if [ ! -x /usr/sbin/named ]; then
    log_action_msg "named binary missing - not starting"
    log_end_msg 1
    exit 1
    fi

    if ! check_network; then
    log_end_msg 1
    exit 1
    fi

    if start-stop-daemon --start --oknodo --quiet --exec /usr/sbin/named \
    --pidfile /var/run/bind/run/named.pid -- $OPTIONS; then
    if [ "X$RESOLVCONF" != "Xno" ] && [ -x /sbin/resolvconf ] ; then
    echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.named
    fi
    log_end_msg 0
    else
    log_end_msg 1
    fi
    ;;

    stop)
    log_daemon_msg "Stopping domain name service..." "bind"
    if ! check_network; then
    log_end_msg 1
    exit 1
    fi

    if [ "X$RESOLVCONF" != "Xno" ] && [ -x /sbin/resolvconf ] ; then
    /sbin/resolvconf -d lo.named
    fi
    /usr/sbin/rndc stop
    log_end_msg $?
    ;;

    reload|force-reload)
    log_daemon_msg "Reloading domain name service..." "bind"
    if ! check_network; then
    log_end_msg 1
    exit 1
    fi

    /usr/sbin/rndc reload >/dev/null
    log_end_msg $?
    ;;

    restart)
    if ! check_network; then
    exit 1
    fi

    $0 stop
    sleep 2
    $0 start
    ;;

    *)
    log_action_msg "Usage: /etc/init.d/bind9 {start|stop|reload|restart|forc
    e-reload}"
    exit 1
    ;;
    esac

    exit 0


     
  5. falko

    falko Super Moderator ISPConfig Developer

    What are the outputs of
    Code:
    netstat -tap
    and
    Code:
    ls -la /etc/bind/
    ?
     
  6. skirao

    skirao New Member

    Hi,

    My server went down yesterday, i will reinstall the server, install DNS and surely get back. But before that, there's something really important i need decide on - the domain name for the intranet.

    I have a domain name "abcd.org" registered on the internet, website managed by an ISP and its working fine. I am planning to have an Intranet site for the students for which i am configuring DNS, can i create a domain say for example, "students.abcd.org" which would be accessible only inside the office? Coz, all the machines have access to the internet so will there be a conflict? The students should be able to access the site using their web browser through the url, http://students.abcd.org!

    Kindly help as this is very crucial.
     
  7. chipsafts

    chipsafts New Member

    Yes, this is what external and internal DNS zones does.
    List the url->ip only in the internal setup zone.
     
  8. skirao

    skirao New Member

    Now, i am able to ping servername.domain.local. and it works. But, when i try to resolve it using nslookup, here's the reply.

    Server: 10.10.10.4
    Address: 10.10.10.4#53

    ** server can't find ns1.student.local.student.local: SERVFAIL

    I have made the correct entries in /etc/resolv.conf
    How can i resolve this?

     
  9. chipsafts

    chipsafts New Member

    you don't have the "." right for
    ns1.student.local
    in your internal configuration file
     
  10. skirao

    skirao New Member

    ok.. In named.conf file, i changed the zone entry from localhost to "ns1.student.local." restarted DNS and below is the result of nslookup. My configuration file is named.conf.local

    nslookup
    > ns1.student.local
    Server: 10.10.10.4
    Address: 10.10.10.4#53

    Name: ns1.student.local
    Address: 127.0.0.1

    It is atleast resolving but the address is 127.0.0.1. which should be 10.10.10.4


     
  11. falko

    falko Super Moderator ISPConfig Developer

    Can you post your zone file?
     
  12. skirao

    skirao New Member

    My apologies for the late reply.

    The contents of ns1.student.local.db

    $TTL 1500
    @ IN SOA ns1.student.local root (
    2007062703 ;serial
    28800 ;refresh
    3600 ;retry
    604800 ;expire
    38400 ) ;minimum 25 minutes
    student.local. IN NS ns1.student.local.
    ns1 IN A 10.10.10.4
    studio-server IN A 10.10.10.10
    student.local. IN MX 10 ns1.student.local.
    ~
    ~
    The contents of rev.10.10.10.in-addr.arpa

    $TTL 1500
    @ IN SOA ns1.student.local. root (
    2007062703 ;serial
    28800 ;refresh
    3600 ;retry
    604800 ;expire
    38400 ) ;minimum 25 minutes

    IN NS ns1.student.local.
    100 IN PTR ns1.student.local.
    #103 IN PTR webserver1.tm.local.
    #104 IN PTR webserver2.tm.local.
    #101 IN PTR load1.tm.local.
    #102 IN PTR load2.tm.local.
    ~
    ~
    ~




     
  13. chipsafts

    chipsafts New Member

    you have not changed the zone file since 2007 ?
     
    Last edited: Sep 4, 2008
  14. skirao

    skirao New Member

    Does that really affect the way DNS works. Coz, i entered the default values when i configured DNS.


     
  15. falko

    falko Super Moderator ISPConfig Developer

    What does
    Code:
    dig @localhost ns1.student.local
    show?
     
  16. skirao

    skirao New Member

    root@ns1:~# dig @localhost ns1.student.local

    ; <<>> DiG 9.4.2-P1 <<>> @localhost ns1.student.local
    ; (1 server found)
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30526
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;ns1.student.local. IN A

    ;; ANSWER SECTION:
    ns1.student.local. 604800 IN A 127.0.0.1

    ;; AUTHORITY SECTION:
    ns1.student.local. 604800 IN NS localhost.

    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Thu Sep 11 13:33:24 2008
    ;; MSG SIZE rcvd: 74



     
  17. chipsafts

    chipsafts New Member

    I'm guessing that ns1.student.local is the servers name and is listed in the /etc/hosts file with 127.0.0.1 first.
     

Share This Page