Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, Is there any problem for BIND that i don't have a /24 class of ip addresses? I mean i have only one IP address. How do i define the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    20

    question on BIND


    Hi,

    Is there any problem for BIND that i don't have a /24 class of ip addresses?

    I mean i have only one IP address. How do i define the address to host mapping file?
    Lets say my ip is 192.168.1.1 and i have db.192.168.1 zone file :

    $TTL 3h
    1.168.192.in-addr.arpa. IN SOA dns.somedomain.org. hostmaster.somedomain.org.(
    1 ; Serial
    3h ; Refresh after 3 hours
    1h ; Retry after 1 hour
    1w ; Expire after 1 week
    1h ) ; Negative caching TTL of 1 hour

    ;
    ; Name servers
    ;
    1.168.192.in-addr.arpa. IN NS dns.somedomain.org.

    ;
    ; Addresses point to canonical name
    ;
    1.1.168.192.in-addr.arpa. IN PTR dns.somedomain.org.

    Is this ok? Will this work?

    P.S. just ignore the private ip - its for demo purpose only, i have a routable ip
    Last edited by OTIM; 11-08-2007 at 11:37 AM. Reason: i double checked my post and modified the SOA according to NS and PTR

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Code:
    $TTL 3h
    1.168.192.in-addr.arpa    IN SOA dns.somedomain.org. hostmaster.somedomain.org.(
                    1  ; Serial
                    3h ; Refresh after 3 hours
                    1h ; Retry after 1 hour
                    1w ; Expire after 1 week
                    1h ) ; Negative caching TTL of 1 hour
    
    ;
    ; Name servers
    ;
    1        NS    dns.somedomain.org.
    
    $ORIGIN 1.168.192.in-addr.arpa.
    ;
    ; Addresses point to canonical name
    ;
    1        PTR    dns.somedomain.org.
    I would suggest that you buy a book on DNS, maybe this one:

    oreilly.com -- Online Catalog: DNS and BIND, Fourth Edition

    and understand what DNS does and how to configure it especially if you are going to make this server public access!!

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    20
    Yupii i made it work
    No i don't want to make it public it is just for me, for study purposes.

    So here is my config, perhaps it might help someone someday, who knows
    named.conf
    options {
    directory "/var/named";
    pid-file "named.pid";
    allow-recursion { 192.168.0/24; } ;
    listen-on { 192.168.0/24; } ;
    version none;
    allow-query { 192.168.0/24; } ;
    allow-transfer { 192.168.0/24; } ;
    };

    zone "ovidiu.org" in {
    type master;
    file "db.ovidiu.org";
    } ;

    zone "0.168.192.in-addr.arpa" in {
    type master;
    file "db.192.168.0";
    } ;

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

    zone "." in {
    type hint;
    file "root.zone";
    } ;
    db.127.0.0
    $TTL 24h
    0.0.127.in-addr.arpa. IN SOA serverx.ovidiu.org. serverx.ovidiu.org. (
    1 ; Serial
    3h ; Refresh after 3 hours
    1h ; Retry after 1 hour
    1w ; Expire after 1 week
    1h ) ; Negative caching TTL of 1 hour

    0.0.127.in-addr.arpa. IN NS serverx.ovidiu.org.
    1.0.0.127.in-addr.arpa. IN PTR localhost.
    db.192.168.0
    $TTL 3h
    0.168.192.in-addr.arpa. IN SOA serverx.ovidiu.org. hostmaster.ovidiu.org. (
    1 ; Serial
    3h ; Refresh after 3 hours
    1h ; Retry after 1 hour
    1w ; Expire after 1 week
    1h ) ; Negative caching TTL of 1 hour
    0.168.192.in-addr.arpa. IN NS serverx.ovidiu.org.
    1.0.168.192.in-addr.arpa. IN PTR serverx.ovidiu.org.
    10.0.168.192.in-addr.arpa. IN PTR anisoara.ovidiu.org.
    db.ovidiu.org
    $TTL 3h
    $ORIGIN ovidiu.org.
    ;
    ;SOA record
    ;
    ovidiu.org. IN SOA serverx.ovidiu.org. hostmaster.ovidiu.org. (
    1 ; Serial
    3h ; Refresh after 3 hours
    1h ; Retry after 1 hour
    1w ; Expire after 1 week
    1h ) ; Negative caching TTL of 1 hour
    ;
    ;NS records
    ;
    ovidiu.org. IN NS serverx.ovidiu.org.
    ;
    ;A records
    ;
    localhost IN A 127.0.0.1
    serverx IN A 192.168.0.1
    anisoara IN A 192.168.0.10
    ;
    ;CNAME records
    ;
    ratisoara IN CNAME anisoara
    Yes i know it can be improved, but for now i'm happy because it works

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Cool!! Maybe sometime in the future you'll play with it some more.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  6. #5
    Just Joined!
    Join Date
    Sep 2007
    Posts
    20
    thanks
    After some reading on internet and on forums it seems there is a mistake in my config.
    So, what i did was this: deleted
    zone "0.0.127.in-addr.arpa" in {
    type master;
    file "db.127.0.0";
    } ;
    and added in named.conf:
    zone "localhost" in {
    type master;
    file "master.localhost";
    allow-update {none;};
    };
    zone "0.0.127.IN-ADDR.ARPA" in{
    type master;
    file "localhost.rev";
    allow-update{none;};
    with the zone files:
    $TTL 1d ;
    $ORIGIN localhost.
    localhost. IN SOA localhost. root.localhost. (
    2002022401 ; serial
    3H ; refresh
    15M ; retry
    1w ; expire
    3h ; minimum
    )
    localhost. IN NS localhost. ; localhost is the name server
    localhost. IN A 127.0.0.1 ; the loop-back address

    $TTL 86400 ; 24 hours
    $ORIGIN 0.0.127.IN-ADDR.ARPA.
    @ IN SOA localhost. root.localhost. (
    1997022700 ; Serial
    3h ; Refresh
    15 ; Retry
    1w ; Expire
    3h ) ; Minimum
    IN NS localhost.
    1 IN PTR localhost.
    When i do "nslookup localhost" i get :
    Name: localhost.ovidiu.org
    Address: 127.0.0.1

    My question is, if someone is kind to explain why do i need this?
    I know that 127.0.0.1 is the loopback address and it is a way that the computer refers to itself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •