?
Solved

how to create zone file

Posted on 2006-10-31
12
Medium Priority
?
263 Views
Last Modified: 2010-04-20
hi,

I would create a reverse zone for my domain,

as an example, when some  one run the command

nslookup 10.1.10.15
he get the reply as

Name:    test1.come.com
Address:  10.1.10.15

my reverse file is like this:
cat 10.1.10.zone
 
$ORIGIN 10.1.10.in-addr.arpa.
$TTL 6h
 
@       IN      SOA     test1.come.com. root.localhost. (        
                        1       ; serial
                        1h      ; refresh
                        30m     ; retry
                        7d      ; expiration
                        1h )    ; minimum
        IN      NS      10.1.50.5
15     IN      PTR     test1.come.com.


now, i would add 10.1.10.16 as test2.come.com
how could i add it to the file??

please if you know also the RFC releated to the same send me its link

thanks for your hlep and support,


0
Comment
Question by:malibusa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
12 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 17842396
add following line after the 15 definition

16 IN PTR test2.come.com.

then modifi(increase) serial value (currently set to 1; serial) and restart named.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17842408
BTW: the zone is somewhow wrong and should generate warning
        IN      NS      10.1.50.5
should have real name instead IP, eg
        IN      NS      real.name.tld.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17842428
> please if you know also the RFC releated to the same send me its link
not really RFC as it's bind configuration.
start from http://langfeldt.net/DNS-HOWTO/BIND-9/
0
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
LVL 35

Expert Comment

by:Duncan Roe
ID: 17845755
You want RFC 1034

In the meantime, here is a working configuration from my server. There are 2 local networks, mshome.net (dynamically updated, router is also a DHCP server for that one), and local.net (static addresses, in fact all in /etc/hosts but having the DNS stops mistyped requests from going out on the Internet)

/etc/networks:

loopback        127.0.0.0
localnet        127.0.0.0
mshome 192.168.0.0
local 10.255.255.0


/etc/named.conf:

acl "locals" { 10.255.255.0/24; 192.168.0.0/24; 127.0.0.0/8; };
options {
  directory "/var/named";
  forward only;
  forwarders { 198.142.0.51; 203.2.75.132; };
  allow-transfer { none; };
  allow-query { "locals"; };
  allow-recursion { "locals"; };
};

zone "mshome.net" IN {
  type master;
  file "mshome.net";
  forwarders { };
  allow-query { "locals"; };
  allow-transfer { "locals"; };
  allow-update { 192.168.0.120; };
};
zone "0.168.192.in-addr.arpa" IN {
  type master;
  file "ten.emohsm";
  forwarders { };
  allow-query { "locals"; };
  allow-transfer { "locals"; };
  allow-update { 192.168.0.120; };
};
zone "local.net" IN {
  type master;
  file "local.net";
  forwarders { };
  allow-query { "locals"; };
};
zone "255.255.10.in-addr.arpa" IN {
  type master;
  file "ten.lacol";
  forwarders { };
  allow-query { "locals"; };
};

It's important to use "master" - this says you're authorative (so if you don't know the answer, there isn't one).

The static zone configs:

/var/named/local.net:

$ORIGIN .
$TTL 86400      ; 1 day
local.net               IN SOA  dullstar. my.email.deleted. (
                                1          ; serial
                                10800      ; refresh (3 hours)
                                900        ; retry (15 minutes)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
                        NS      DULLSTAR.MSHOME.NET.
$ORIGIN local.net.
$TTL 302400     ; 3 days 12 hours
dimstar                 A       10.255.255.1
darkstar                A       10.255.255.2
dullstar                A       10.255.255.3
drylstar                A       10.255.255.4

/var/named/ten.lacol:

$ORIGIN .
$TTL 86400      ; 1 day
255.255.10.in-addr.arpa IN SOA  dullstar. my.email.deleted.255.255.10.in-addr.arpa. (
                                1          ; serial
                                10800      ; refresh (3 hours)
                                900        ; retry (15 minutes)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
                        NS      DULLSTAR.MSHOME.NET.
$ORIGIN 255.255.10.in-addr.arpa.
$TTL 302400     ; 3 days 12 hours
1                       PTR     dimstar.local.net.
2                       PTR     darkstar.local.net.
3                       PTR     dullstar.local.net.
4                       PTR     dimstar.local.net.

Note the backwards spelling of local. Also note that all reverse lookups belong to the domain in-addr.arpa.

Good luck - post if you have any troubles
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 17845766
Probablythe NS records should be DULLSTAR.LOCAL.NET but it works for me as_is
0
 

Author Comment

by:malibusa
ID: 17848498
don't i need to define again something like

@       IN      SOA     test1.come.com. root.localhost. (        
                        1       ; serial
                        1h      ; refresh
                        30m     ; retry
                        7d      ; expiration
                        1h )    ; minimum

for test2

or i should just add the line
16 IN PTR test2.come.com.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17848589
Since it's in same zone - just add the line, bump the serial and restart bind(named).
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 17852859
Why have you got IN as well as PTR? I only have IN on SOA lines, not on PTR lines. That's the way DNS creates dynamic records as well.

16 PTR test2.come.com.
0
 

Author Comment

by:malibusa
ID: 17872892
yes, it works,

i have a second need, which is dependant, I am not sure if  I should open another Q,

any way, if you could help me,
I would route the unresolved hosts to another NS,
what i did is:

$ORIGIN 10.1.10.in-addr.arpa.
$TTL 6h
 
@       IN      SOA     come.com. root.localhost. (        
                        1       ; serial
                        1h      ; refresh
                        30m     ; retry
                        7d      ; expiration
                        1h )    ; minimum
@       NS      10.1.50.5
114     PTR     av1.come.com.
14      NS      10.1.55.13
122     NS      10.1.55.13

this way if i try to resolve,
10.1.10.114 it will be resolved to av1.come.com
if i resove 10.1.10.14 or 10.1.10.122 it will forward to another DNS for resoving,

my Q, is could i ask to transfer all, unless specificly defined,

or could i define a range to be forwarded,
i mean the range 123 till 254 to be transfered to 10.1.55.13 in one command line

hopefully, i was able to deliver my idea clearly

regards,
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17873331
> @       NS      10.1.50.5
RFC says there should be full name instead of ip address - just warning.

You have two options:
$GENERATE 1-40 $ NS     delegated.ns.server. //generates names for 1 .. 40
* NS delegated.ns.server. //but some clients&servers(like cache) have trouble with it.
0
 

Author Comment

by:malibusa
ID: 17875692
dear ravenpl

the first option which is
$GENERATE 1-40 $ NS     delegated.ns.server.
works fine with me,
but not the second,
* NS delegated.ns.server.   //if i use this, nothing works, unless if you were meaning to write it with the generate command

----------

Dear, another Q,
could i delegate to more than one NS server, as if one is down it forward to the second, or do round-robin between them

appreciating your help alot

best regards,
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 1600 total points
ID: 17875780
I warned that the star may not work...
Yes You can delegate to as many nameservers as You want.
name NS one.server.tld.
name NS two.server.tld.
name NS three.server.tld.
$GENERATE 1-40 $ NS     delegated.ns.server.
$GENERATE 1-40 $ NS     another.delegated.ns.server.
$GENERATE 1-40 $ NS     third.delegated.ns.server.
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question