LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DNS forward look up ( hosts resolution ) (http://www.linuxquestions.org/questions/linux-networking-3/dns-forward-look-up-hosts-resolution-4175428102/)

woow 09-19-2012 08:58 PM

DNS forward look up ( hosts resolution )
 
I try to set up a dns server on Centos VM and I cannot get correct resolution to the host name.
I can ping the FQN name of any host but not the host it self.

That is:

I get an error >> Host vm1 not found: 3(NXDOMAIN) <<

Code:

vm1:~ root # host localhost
localhost has address 127.0.0.1
localhost has IPv6 address ::1

vm1:~ root # ping vm1
ping: unknown host vm1

vm1:~ root # ping vm1.local.internal
PING vm1.local.internal (192.168.1.221) 56(84) bytes of data.
64 bytes from vm1.local.internal (192.168.1.221): icmp_seq=1 ttl=64 time=0.022 ms
64 bytes from vm1.local.internal (192.168.1.221): icmp_seq=2 ttl=64 time=0.039 ms

vm1:~ root # host 192.168.1.221
221.1.168.192.in-addr.arpa domain name pointer vm1.local.internal.

vm1:~ root # host vm1
Host vm1 not found: 3(NXDOMAIN)

vm1:~ root # host vm2
Host vm1 not found: 3(NXDOMAIN)

vm1:~ root # ping vm2.local.internal
PING vm2.local.internal (192.168.1.222) 56(84) bytes of data.
64 bytes from vm2.local.internal (192.168.1.222): icmp_seq=1 ttl=64 time=8.70 ms
64 bytes from vm2.local.internal (192.168.1.222): icmp_seq=2 ttl=64 time=0.328 ms

Below are the configuration files:

Code:

vm1:~ root # cat /var/named/local.internal
$TTL 1800
@        IN SOA        local.internal. root.local.internal. (
                                        2012092004        ; serial
                                        1D                ; refresh
                                        1H                ; retry
                                        1W                ; expire
                                        3H )                ; minimum
@        IN        NS                vm1.local.internal.

        IN        MX        1        vm1.local.internal.
        IN        MX        2        vm2.local.internal.

vm1        IN        A        192.168.1.221
vm2        IN        A        192.168.1.222

Code:

vm1:~ root # cat /var/named/local.internal.reverse
$TTL 60
@        IN        SOA        vm1.local.internal.        root.local.internal. (
                                2012091902        ;        serial
                                        1D        ;        refresh
                                        1H        ;        retry
                                        1W        ;        expire
                                        3H        ); minimum

@                IN        NS        vm1.local.internal.       

221                IN        PTR        vm1.local.internal.       
222                IN        PTR        vm2.local.internal.

Code:


zone "." IN {
        type hint;
        file "named.ca";
};

zone "local.internal" IN {
        type master;
        file "local.internal";
        allow-update { none; };
};

zone "1.168.192.in-addr.arpa." IN {
            type master;
        file "local.internal.reverse";
        allow-update { none; };
};

Can smbd give any explanation why is the host command is not resolving?

Thank you.

bathory 09-20-2012 12:42 AM

Hi,

You need to add one of the following:
Code:

domain local.internal
search local.internal

in /etc/resolv.conf.
See the resolv.conf manpage for more details

Regards


All times are GMT -5. The time now is 06:24 PM.