DNS Issues

Discussion in 'Installation/Configuration' started by jamesl22, Dec 20, 2011.

  1. jamesl22

    jamesl22 New Member

    I'm running a Debian 6 server and I uses the single server tutorial. I can't get dns to work. When I type:

    Code:
    root@ks362131:~# dig @localhost censeoenergy.co.uk
    
    ; <<>> DiG 9.7.3 <<>> @localhost censeoenergy.co.uk
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49647
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
    
    ;; QUESTION SECTION:
    ;censeoenergy.co.uk.            IN      A
    
    ;; ANSWER SECTION:
    censeoenergy.co.uk.     86400   IN      A       91.121.172.34
    
    ;; AUTHORITY SECTION:
    censeoenergy.co.uk.     86400   IN      NS      ns2.sitemamba.com.
    censeoenergy.co.uk.     86400   IN      NS      ns1.sitemamba.com.
    
    ;; ADDITIONAL SECTION:
    ns1.sitemamba.com.      37199   IN      A       91.121.172.34
    ns2.sitemamba.com.      34826   IN      A       91.121.172.34
    
    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Tue Dec 20 02:58:56 2011
    ;; MSG SIZE  rcvd: 133
    
    
    All goes well. However, when I type:

    Code:
    root@ns2:~# dig @91.121.172.34 censeoenergy.co.uk
    
    ; <<>> DiG 9.7.3 <<>> @91.121.172.34 censeoenergy.co.uk
    ; (1 server found)
    ;; global options: +cmd
    ;; connection timed out; no servers could be reached
    
    It times out and I get no response. What is wrong?

    Thanks,

    James
     
  2. falko

    falko Super Moderator Howtoforge Staff

    What are the outputs of
    Code:
    netstat -tap
    and
    Code:
    iptables -L
    ?
     
  3. jamesl22

    jamesl22 New Member

    Fixed it now. Bind was not listening on anything other than localhost.
     
  4. wcsing

    wcsing Member

    Hi Jamesl22,

    I have the same DNS problem, can you give some detail how to fix it? Thanks.

    tadj2:~ # netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 localhost:dyna-access *:* LISTEN 1965/clamd
    tcp 0 0 *:pop3 *:* LISTEN 1949/dovecot
    tcp 0 0 *:imap *:* LISTEN 1949/dovecot
    tcp 0 0 *:http-alt *:* LISTEN 1794/httpd2-prefork
    tcp 0 0 *:www-http *:* LISTEN 1794/httpd2-prefork
    tcp 0 0 *:sunproxyadmin *:* LISTEN 1794/httpd2-prefork
    tcp 0 0 *:ftp *:* LISTEN 1894/pure-ftpd (SER
    tcp 0 0 tadj2.computerin:domain *:* LISTEN 1395/named
    tcp 0 0 localhost:domain *:* LISTEN 1395/named
    tcp 0 0 localhost:ipp *:* LISTEN 1545/cupsd
    tcp 0 0 *:smtp *:* LISTEN 2200/master
    tcp 0 0 localhost:953 *:* LISTEN 1395/named
    tcp 0 0 *:https *:* LISTEN 1794/httpd2-prefork
    tcp 0 0 localhost:10024 *:* LISTEN 2047/amavisd (maste
    tcp 0 0 localhost:10025 *:* LISTEN 2200/master
    tcp 0 0 *:mysql *:* LISTEN 1866/mysqld
    tcp 0 0 tadj2.computerins:50337 tadj2.computer:http-alt ESTABLISHED 2605/firefox-bin
    tcp 0 0 localhost:mysql localhost:58125 ESTABLISHED 1866/mysqld
    tcp 0 0 localhost:58125 localhost:mysql ESTABLISHED 2364/amavisd (ch1-a
    tcp 0 0 tadj2.computerins:58747 syd01s12-in-f1:www-http ESTABLISHED 2605/firefox-bin
    tcp 0 0 tadj2.computerins:60631 www-15-02-snc5:www-http ESTABLISHED 2605/firefox-bin
    tcp 69 0 localhost:46649 localhost:10025 CLOSE_WAIT 2364/amavisd (ch1-a
    tcp 0 0 tadj2.computer:http-alt tadj2.computerins:50337 ESTABLISHED 3064/httpd2-prefork
    tcp 0 0 *:ftp *:* LISTEN 1894/pure-ftpd (SER
    tcp 0 0 *:domain *:* LISTEN 1395/named
    tcp 0 0 localhost:ipp *:* LISTEN 1545/cupsd
    tcp 0 0 *:smtp *:* LISTEN 2200/master
    tcp 0 0 localhost:953 *:* LISTEN 1395/named
    tadj2:~ # iptables -L
    Chain INPUT (policy ACCEPT)
    target prot opt source destination

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination
     
  5. jamesl22

    jamesl22 New Member

    Edit /etc/bind/named.conf.options and change the lines:
    Code:
    listen-on{ 127.0.0.1; }
    allow-recursion{ 127.0.0.1; }
    
    To read:

    Code:
    listen-on{ all; }
    allow-recursion{ all; }
     
  6. wcsing

    wcsing Member

    I can not find /etc/bind/named.conf.options. (may be i'm using SUSE)
    Will keep looking. Many thanks anyway.
     
  7. falko

    falko Super Moderator Howtoforge Staff

    What's in your /etc/named.conf?
     
  8. wcsing

    wcsing Member

    My /etc/named.conf :

    # Copyright (c) 2001-2004 SuSE Linux AG, Nuernberg, Germany.
    # All rights reserved.
    #
    # Author: Frank Bodammer, Lars Mueller <[email protected]>
    #
    # /etc/named.conf
    #
    # This is a sample configuration file for the name server BIND 9. It works as
    # a caching only name server without modification.
    #
    # A sample configuration for setting up your own domain can be found in
    # /usr/share/doc/packages/bind/sample-config.
    #
    # A description of all available options can be found in
    # /usr/share/doc/packages/bind/misc/options.

    options {

    # The directory statement defines the name server's working directory

    directory "/var/lib/named";

    # Write dump and statistics file to the log subdirectory. The
    # pathenames are relative to the chroot jail.

    dump-file "/var/log/named_dump.db";
    statistics-file "/var/log/named.stats";

    # The forwarders record contains a list of servers to which queries
    # should be forwarded. Enable this line and modify the IP address to
    # your provider's name server. Up to three servers may be listed.

    #forwarders { 192.0.2.1; 192.0.2.2; };

    # Enable the next entry to prefer usage of the name server declared in
    # the forwarders section.

    #forward first;

    # The listen-on record contains a list of local network interfaces to
    # listen on. Optionally the port can be specified. Default is to
    # listen on all interfaces found on your system. The default port is
    # 53.

    #listen-on port 53 { 127.0.0.1; };

    # The listen-on-v6 record enables or disables listening on IPv6
    # interfaces. Allowed values are 'any' and 'none' or a list of
    # addresses.

    listen-on-v6 { any; };

    # The next three statements may be needed if a firewall stands between
    # the local server and the internet.

    #query-source address * port 53;
    #transfer-source * port 53;
    #notify-source * port 53;

    # The allow-query record contains a list of networks or IP addresses
    # to accept and deny queries from. The default is to allow queries
    # from all hosts.

    #allow-query { 127.0.0.1; };

    # If notify is set to yes (default), notify messages are sent to other
    # name servers when the the zone data is changed. Instead of setting
    # a global 'notify' statement in the 'options' section, a separate
    # 'notify' can be added to each zone definition.

    notify no;

    disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
    };

    # To configure named's logging remove the leading '#' characters of the
    # following examples.
    #logging {
    # # Log queries to a file limited to a size of 100 MB.
    # channel query_logging {
    # file "/var/log/named_querylog"
    # versions 3 size 100M;
    # print-time yes; // timestamp log entries
    # };
    # category queries {
    # query_logging;
    # };
    #
    # # Or log this kind alternatively to syslog.
    # channel syslog_queries {
    # syslog user;
    # severity info;
    # };
    # category queries { syslog_queries; };
    #
    # # Log general name server errors to syslog.
    # channel syslog_errors {
    # syslog user;
    # severity error;
    # };
    # category default { syslog_errors; };
    #
    # # Don't log lame server messages.
    # category lame-servers { null; };
    #};

    # The following zone definitions don't need any modification. The first one
    # is the definition of the root name servers. The second one defines
    # localhost while the third defines the reverse lookup for localhost.

    zone "." in {
    type hint;
    file "root.hint";
    };

    zone "localhost" in {
    type master;
    file "localhost.zone";
    };

    zone "0.0.127.in-addr.arpa" in {
    type master;
    file "127.0.0.zone";
    };

    zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
    type master;
    file "127.0.0.zone";
    };


    # Include the meta include file generated by createNamedConfInclude. This
    # includes all files as configured in NAMED_CONF_INCLUDE_FILES from
    # /etc/sysconfig/named

    include "/etc/named.conf.include";

    # You can insert further zone records for your own domains below or create
    # single files in /etc/named.d/ and add the file names to
    # NAMED_CONF_INCLUDE_FILES.
    # See /usr/share/doc/packages/bind/README.SUSE for more details.

    ====================================================
    My /etc/named.conf.include ;

    zone "computerinstruments.com.au" {
    type master;
    allow-transfer {none;};
    file "/var/lib/named/pri.computerinstruments.com.au";
    };

    Thanks.
     
  9. jamesl22

    jamesl22 New Member

    This line:

    Code:
    #listen-on port 53 { 127.0.0.1; };
    Must read:

    Code:
    listen-on port 53 { any; };
     
  10. wcsing

    wcsing Member

    Try it, but still no good. Will re install the O/S and start from the beginning. Many thanks.
     
  11. jamesl22

    jamesl22 New Member

    Ok, I suggest you use debian this time round. It will solve you a lot of bother.
     

Share This Page