Intranet DNS configuration ?

Discussion in 'Server Operation' started by soroccoheaven, Aug 22, 2007.

  1. soroccoheaven

    soroccoheaven New Member

    hi,
    I am trying to configure DNS (BIND 9) for my local lan only. I want it for my apache/squirrelmail access from local lan pc's (dont have real IP ).My apache and postfix with squirrelmail running successfully.My problem is that i can not access my web server from other pc's in my lan by htt://host.localdomain but can access it by http://ipaddress_server.
    I have gone through many configurations but failed to get it running.pls help.
    Thanks
     
  2. Ben

    Ben Active Member Moderator

    which dns-server is set on the clients you try to access / lookup host.localdomain?
    What is the output of
    nslookup host.localdomain
    from such client?

    What happens if you run
    nslookup host.localdomain
    or
    dig host.localdomain
    (depending on Windows / Linux) as OS
    on the DNS-Server machine? Does this result in a lookup for the correct IP?
     
  3. soroccoheaven

    soroccoheaven New Member

    server hostname :serv.lin.ald, ip address : 192.168.2.2
    on windowx pc i dns is set to 192.168.2.2
    and than i am trying to access the http://serv.lin.ald but no success.
    but http://192.168.2.2 wotking.
    from the same winxp PC :
    C:\>nslookup serv.lin.ald
    DNS request timed out.
    timeout was 2 seconds.
    *** Can't find server name for address 192.168.2.2: Timed out
    *** Default servers are not available
    Server: UnKnown
    Address: 192.168.2.2

    *** UnKnown can't find serv.lin.ald: Server failed
    means my DNS int working.
     
  4. soroccoheaven

    soroccoheaven New Member

    will you pls guide me what should i put in named.conf, what zone's and and in zones files. (for Local Lan only)
     
  5. soroccoheaven

    soroccoheaven New Member

    i am having 3 PC's named as Boss (192.168.2.3), Home (192.168.2.4) , star (192.168.2.5) and my Mandrake 10.1 is acting as Web , Mail server (postfix,squirrelmail) i am able to see my index page/squirrelmail login page by IP address only (from boss,home,star), and from mandrake itself its fine i can see it by http://serv.lin.ald

    I am trying to configure DNS for the purpose so that i can access my web/mail by giving http://serv.lin.ald from boss,home and star.
     
  6. Ben

    Ben Active Member Moderator

    The message means, that the DNS-Server that is expected to run on 192.168.2.2 is not answering.
    So at first you have to check on that machine why this is working / or not.

    For a general Information look at this howto: http://www.howtoforge.com/traditional_dns_howto
    or check other howtos in the DNS-category
     
  7. soroccoheaven

    soroccoheaven New Member

    i have gone through several changes to my zone files now i am geting error like :
    Aug 23 17:10:37 serv named[23432]: dns_rdata_fromtext: named.local:3: near '20067042100': out of range
    Aug 23 17:10:37 serv named[23432]: zone 0.0.127.in-addr.arpa/IN: loading master file named.local: out of range
    what is this OUT OF RANGE !!!
     
  8. Ben

    Ben Active Member Moderator

  9. soroccoheaven

    soroccoheaven New Member

    Now i am through ..

    I am getting this from my winxp : (192.168.2.3)


    C:\>nslookup serv.lin.ald
    Server: serv.lin.ald
    Address: 192.168.2.2

    Name: serv.lin.ald
    Address: 192.168.2.2


    C:\>nslookup 192.168.2.2
    Server: serv.lin.ald
    Address: 192.168.2.2

    Name: serv.lin.ald
    Address: 192.168.2.2

    and :

    C:\>nslookup
    Default Server: serv.lin.ald
    Address: 192.168.2.2

    > boss.serv.lin.ald
    Server: serv.lin.ald
    Address: 192.168.2.2

    *** serv.lin.ald can't find boss.serv.lin.ald: Non-existent domain
    > home.serv.lin.ald
    Server: serv.lin.ald
    Address: 192.168.2.2

    *** serv.lin.ald can't find home.serv.lin.ald: Non-existent domain
    > linuxquestions.org
    Server: serv.lin.ald
    Address: 192.168.2.2

    Non-authoritative answer:
    Name: linuxquestions.org
    Address: 64.179.4.146


    from Linux box i am getting :
    [root@serv etc]# dig serv.lin.ald

    ; <<>> DiG 9.3.0 <<>> serv.lin.ald
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24398
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;serv.lin.ald. IN A

    ;; ANSWER SECTION:
    serv.lin.ald. 259200 IN A 192.168.2.2

    ;; AUTHORITY SECTION:
    lin.ald. 259200 IN NS www.lin.ald.

    ;; Query time: 2 msec
    ;; SERVER: 192.168.2.2#53(192.168.2.2)
    ;; WHEN: Thu Aug 23 20:25:06 2007
    ;; MSG SIZE rcvd: 64

    [root@serv etc]#

    [root@serv etc]# dig yahoo.com

    ; <<>> DiG 9.3.0 <<>> yahoo.com
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47365
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 7, ADDITIONAL: 2

    ;; QUESTION SECTION:
    ;yahoo.com. IN A

    ;; ANSWER SECTION:
    yahoo.com. 300 IN A 66.94.234.13
    yahoo.com. 300 IN A 216.109.112.135

    ;; AUTHORITY SECTION:
    yahoo.com. 172800 IN NS ns3.yahoo.com.
    yahoo.com. 172800 IN NS ns4.yahoo.com.
    yahoo.com. 172800 IN NS ns5.yahoo.com.
    yahoo.com. 172800 IN NS ns6.yahoo.com.
    yahoo.com. 172800 IN NS ns8.yahoo.com.
    yahoo.com. 172800 IN NS ns1.yahoo.com.
    yahoo.com. 172800 IN NS ns2.yahoo.com.

    ;; ADDITIONAL SECTION:
    ns6.yahoo.com. 172800 IN A 202.43.223.170
    ns8.yahoo.com. 172800 IN A 202.165.104.22

    ;; Query time: 101 msec
    ;; SERVER: 192.168.2.2#53(192.168.2.2)
    ;; WHEN: Thu Aug 23 20:30:52 2007
    ;; MSG SIZE rcvd: 217

    [root@serv etc]#
     
  10. soroccoheaven

    soroccoheaven New Member

    pls have a look on bind files:

    /etc/named.conf

    controls {
    inet 127.0.0.1 port 953
    allow { 127.0.0.1; } keys { mykey; };
    };
    options {
    version "";
    directory "/var/named";
    dump-file "/var/tmp/named_dump.db";
    pid-file "/var/run/named/named.pid";
    statistics-file "/var/tmp/named.stats";
    zone-statistics yes;
    auth-nxdomain yes;
    query-source address * port *;
    listen-on port 53 { any; };
    cleaning-interval 120;
    transfers-in 20;
    transfers-per-ns 2;
    lame-ttl 0;
    max-ncache-ttl 10800;
    allow-transfer { none; };
    };
    acl localhosts {
    127.0.0.0/24;
    192.168.2.0/24;
    };

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

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

    zone "lin.ald" {
    type master;
    notify no;
    allow-query { any; };
    file "lin.ald";
    };

    zone "2.168.192.in-addr.arpa" {
    type master;
    notify no;
    file "192.168.2.zone";
    };


    named.local file :

    [root@serv etc]# cat /var/named/named.local
    ; named.local file
    $TTL 3h
    @ IN SOA serv.lin.ald. vareesh.localhost. (
    2006704210 ; Serial
    3h ; Refresh after 3 hours
    1h ; Retry after 1 hour
    1w ; Expire after 1 week
    1h ) ; Minimum TTL of 1 day

    NS serv.lin.ald.
    1 PTR localhost.

    lin.ald file :

    [root@serv etc]# cat /var/named/lin.ald
    ;
    ; Zone file for lin.ald
    ;
    ; The full zone file
    ;
    $TTL 3D
    @ IN SOA serv.lin.ald. vareesh.serv.lin.ald. (
    2006111512 ; serial#
    3600 ; refresh, seconds
    3600 ; retry, seconds
    3600 ; expire, seconds
    3600 ) ; minimum, seconds

    NS www ; Inet Address of nameserver
    serv.lin.ald. MX 10 mail ; Primary Mail Exchanger
    serv.lin.ald. A 192.168.2.2
    mail CNAME serv.lin.ald.
    www CNAME serv
    [root@serv etc]#


    192.168.2.zone file :

    [root@serv etc]# cat /var/named/192.168.2.zone

    $TTL 3D
    @ IN SOA serv.lin.ald. vareesh.localhost. (
    2006012103 ; serial number
    28800 ; refresh, seconds
    7200 ; retry, seconds
    604800 ; expire, seconds
    86400 ) ; minimum, seconds
    NS serv.lin.ald. ; Nameserver Address
    1 PTR linksys.serv.lin.ald.
    2 PTR serv.lin.ald.
    3 PTR boss.serv.lin.ald.
    4 PTR home.serv.lin.ald.

    [root@serv etc]#
     
  11. soroccoheaven

    soroccoheaven New Member

    forward lookup not working BIND

    hello,
    my bind isnt working for forward lookup only..

    This log has been taken from winxp, host name boss ip addrees 192.168.2.2 using 192.168.2.2 as dns)

    > 192.168.2.3
    Server: serv.lin.ald
    Address: 192.168.2.2

    Name: boss.serv.lin.ald
    Address: 192.168.2.3

    > 192.168.2.4
    Server: serv.lin.ald
    Address: 192.168.2.2

    Name: home.serv.lin.ald
    Address: 192.168.2.4

    > boss.serv.lin.ald
    Server: serv.lin.ald
    Address: 192.168.2.2

    *** serv.lin.ald can't find boss.serv.lin.ald: Server failed
    > home.serv.lin.ald
    Server: serv.lin.ald
    Address: 192.168.2.2

    *** serv.lin.ald can't find home.serv.lin.ald: Server failed
    >

    pls advice.
     
  12. soroccoheaven

    soroccoheaven New Member

    anyone please help me about this ..

    i ahve done several changes but still i am not able to resolve name -ip address

    these log has been taken from server itself where as boss and home are winxp pc's in my lan.

    [root@serv root]# nslookup
    > 192.168.2.4
    Server: 192.168.2.2
    Address: 192.168.2.2#53

    4.2.168.192.in-addr.arpa name = home.serv.lin.ald.
    > 192.168.2.3
    Server: 192.168.2.2
    Address: 192.168.2.2#53

    3.2.168.192.in-addr.arpa name = boss.serv.lin.ald.

    > home.serv.lin.ald
    ;; Got SERVFAIL reply from 192.168.2.2, trying next server
    Server: 61.1.96.71
    Address: 61.1.96.71#53

    ** server can't find home.serv.lin.ald: NXDOMAIN
    > boss.serv.lin.ald
    ;; Got SERVFAIL reply from 192.168.2.2, trying next server
    Server: 61.1.96.71
    Address: 61.1.96.71#53

    ** server can't find boss.serv.lin.ald: NXDOMAIN

    Even ..

    > serv.lin.ald
    ;; Got SERVFAIL reply from 192.168.2.2, trying next server
    Server: 61.1.96.69
    Address: 61.1.96.69#53

    ** server can't find serv.lin.ald: NXDOMAIN
    >

    but when i type serv.lin.ald in my browser i am able to see my webpage from server as well as from other machines in my network..
     
  13. falko

    falko Super Moderator Howtoforge Staff

    Did you configure your zones on 192.168.2.2?
    Did you add your internal nameserver (192.168.2.2?) to /etc/resolv.conf (as the first nameserver entry) on the clients?
     
  14. soroccoheaven

    soroccoheaven New Member

    Thanks for you repply but now it seems working to me i am able to resolve ip-name and vice-versa ...still i am not sure what was causing of the problem.
     

Share This Page