Results 1 to 5 of 5

Thread: DNS problem on CENTOS 6

  1. #1

    DNS problem on CENTOS 6

    Hi All,
    Please check my config and help me fix.

    I install 3 packet: bind

    [root@server2 ~]# rpm -qa bind*
    bind-libs-9.7.0-5.P2.el6_0.1.i686
    bind-utils-9.7.0-5.P2.el6_0.1.i686
    bind-9.7.0-5.P2.el6_0.1.i686

    [root@server2 ~]# cat /etc/named.conf
    //
    // named.conf
    //
    // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
    // server as a caching only nameserver (as a localhost DNS resolver only).
    //
    // See /usr/share/doc/bind*/sample/ for example named configuration files.
    //

    options {
    listen-on port 53 { 127.0.0.1;192.168.5.2; };
    #listen-on-v6 port 53 { ::1; };
    #Add by me (change if not use IPv6)
    listen-on-v6 {none;};

    directory "/var/named";
    dump-file "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query { localhost; 192.168.5.0/24;};
    recursion yes;

    dnssec-enable yes;
    dnssec-validation yes;
    dnssec-lookaside auto;

    /* Path to ISC DLV key */
    # bindkeys-file "/etc/named.iscdlv.key";
    };

    logging {
    channel default_debug {
    file "data/named.run";
    severity dynamic;
    };
    };

    view "internal" {
    zone "." IN {
    type hint;
    file "named.ca";
    };
    zone "hightechvn" IN {
    type master;
    file "hightechvn.db";
    allow-update {none;};
    };

    zone "5.168.192.in-addr.arpa" IN {
    type master;
    file "192.168.5.rev";
    allow-update {none;};
    };
    include "/etc/named.rfc1912.zones";

    ///////////////////////////////////////////////////////////////////

    [root@server2 ~]# ls -l /var/named/
    total 36
    -rw-r--r-- 1 root root 378 Sep 25 11:05 192.168.5.rev
    drwxrwx--- 2 named named 4096 Sep 25 00:17 data
    drwxrwx--- 2 named named 4096 Sep 25 20:38 dynamic
    -rw-r--r-- 1 root root 331 Sep 25 11:04 hightechvn.db
    -rw-r----- 1 root named 1892 Feb 18 2008 named.ca
    -rw-r----- 1 root named 152 Dec 15 2009 named.empty
    -rw-r----- 1 root named 152 Jun 21 2007 named.localhost
    -rw-r----- 1 root named 168 Dec 15 2009 named.loopback
    drwxrwx--- 2 named named 4096 Jun 25 10:45 slaves

    /////////////////////////////////////////////////////////////////////////////////////

    [root@server2 ~]# cat /var/named/hightechvn.db
    $TTL 3D
    @ IN SOA server2.hightechvn.local. root.hightechvn.local. (
    2011092501 ; serial
    1D ; refresh
    1H ; retry
    1W ; expire
    3H ) ; minimum

    ; define nameserver
    IN NS server2.hightechvn.local.
    IN A 192.168.5.2
    ; IN AAAA ::1
    server1 IN A 192.168.5.1
    server2 IN A 192.168.5.2
    server3 IN A 192.168.5.3

    [root@server2 ~]# cat /var/named/192.168.5.rev
    $TTL 3D
    @ IN SOA server2.hightechvn.local. root.hightechvn.local. (
    2011092501 ; serial
    1D ; refresh
    1H ; retry
    1W ; expire
    3H ) ; minimum
    ;define name server
    IN NS server2.hightechvn.local.

    ; IN AAAA ::1
    ; define IP address and hostname
    1 IN PTR server1.hightechvn.local.
    2 IN PTR server2.hightechvn.local.
    3 IN PTR server3.hightechvn.local.


    ////////////////////////////////////

    [root@server2 ~]# hostname
    server2.hightechvn.local

    ////////////////////////////////////

    [root@server2 ~]# cat /etc/hosts
    192.168.5.2 server2.hightechvn.local server2 # Added by NetworkManager
    127.0.0.1 localhost.localdomain localhost
    ::1 server2.hightechvn.local server2 localhost6.localdomain6 localhost6

    //////////////////////////////////////////

    When I check named.conf have one problem here

    [root@server2 ~]# named-checkconf -t /etc/named.conf
    isc_dir_chroot: invalid file


    ////////////////////////////////////////////////////////////

    [root@server2 ~]# named-checkconf -t /var/named/ /etc/named.conf
    none:0: open: /etc/named.conf: file not found



    ////////////////////////////////////////////////////////

    [root@server2 ~]# named -u named -t /var/named/ -g
    25-Sep-2011 14:11:10.032 starting BIND 9.7.0-P2-RedHat-9.7.0-5.P2.el6_0.1 -u named -t /var/named/ -g
    25-Sep-2011 14:11:10.032 built with '--build=i686-pc-linux-gnu' '--host=i686-pc-linux-gnu' '--target=i686-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-libtool' '--localstatedir=/var' '--enable-threads' '--enable-ipv6' '--with-pic' '--disable-static' '--disable-openssl-version-check' '--with-dlz-ldap=yes' '--with-dlz-postgres=yes' '--with-dlz-mysql=yes' '--with-dlz-filesystem=yes' '--with-gssapi=yes' '--disable-isc-spnego' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'target_alias=i686-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' 'CPPFLAGS= -DDIG_SIGCHASE'
    25-Sep-2011 14:11:10.032 adjusted limit on open files from 1024 to 1048576
    25-Sep-2011 14:11:10.032 found 1 CPU, using 1 worker thread
    25-Sep-2011 14:11:10.032 using up to 4096 sockets
    25-Sep-2011 14:11:10.046 loading configuration from '/etc/named.conf'
    25-Sep-2011 14:11:10.046 none:0: open: /etc/named.conf: file not found
    25-Sep-2011 14:11:10.047 loading configuration: file not found
    25-Sep-2011 14:11:10.047 exiting (due to fatal error)


    ////////////////////////////////////////////////

    [root@server2 ~]# named-checkzone hightechvn.local /var/named/hightechvn.db
    zone hightechvn.local/IN: loaded serial 2011092501
    OK

    [root@server2 ~]# named-checkzone 192.168.5.2 /var/named/192.168.5.rev zone 192.168.5.2/IN: loaded serial 2011092501
    OK

    [root@server2 ~]# /etc/init.d/named start
    Starting named: named: already running [ OK ]
    [root@server2 ~]# /etc/init.d/named restart
    Stopping named: [ OK ]
    Starting named: [ OK ]


    /////////////////////////////////////////////////////////

    [root@server2 ~]# host server2.hightechvn.local
    Host server2.hightechvn.local not found: 3(NXDOMAIN)

    [root@server2 ~]# ping server2
    PING server2.hightechvn.local (192.168.5.2) 56(84) bytes of data.
    64 bytes from server2.hightechvn.local (192.168.5.2): icmp_seq=1 ttl=64 time=0.034 ms
    64 bytes from server2.hightechvn.local (192.168.5.2): icmp_seq=2 ttl=64 time=0.043 ms
    64 bytes from server2.hightechvn.local (192.168.5.2): icmp_seq=3 ttl=64 time=0.038 ms
    64 bytes from server2.hightechvn.local (192.168.5.2): icmp_seq=4 ttl=64 time=0.045 ms
    ^C

    That's all my conffig . Please check help me.


    Thanks .

    Hoavn

  2. #2
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811
    Are you trying to run bind chrooted to /var/named ??If so, you need to create /var/named/etc and place your named.conf in it ie: cp -p /etc/named.conf /var/named/etc/For futher info, check the chroot guide
    Don't worry Ma'am. We're university students, - We know what We're doing.
    'Ruiat coelum, fiat voluntas tua.'
    Datalogi - en livsstil; Intet liv, ingen stil.

  3. #3
    Quote Originally Posted by redhead View Post
    Are you trying to run bind chrooted to /var/named ??If so, you need to create /var/named/etc and place your named.conf in it ie: cp -p /etc/named.conf /var/named/etc/For futher info, check the chroot guide
    I was follow your guide but stilll not work. I don't know how to resolve.

    Hoavn

  4. #4
    check the /etc/sysconfig/named file. commet the ROOTDIR=/var/named/chroot and try.

  5. #5
    Associate maheshkumar's Avatar
    Join Date
    Jul 2011
    Location
    India, HYD
    Posts
    12

Similar Threads

  1. why not centos ?
    By cognitiveLinux in forum Linux Distros
    Replies: 0
    Last Post: 02-06-2012, 10:43 PM
  2. DNS in CentOS
    By cga in forum Linux - Hardware, Networking & Security
    Replies: 23
    Last Post: 09-05-2011, 01:45 AM
  3. Replies: 1
    Last Post: 01-21-2011, 12:06 AM
  4. CentOS
    By cga in forum Redhat / Fedora
    Replies: 5
    Last Post: 02-23-2006, 04:32 PM
  5. CentOS
    By mannyamador in forum Linux - General Topics
    Replies: 0
    Last Post: 01-16-2006, 05:28 PM

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
  •