LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-12-2016, 09:31 PM   #1
hilou
Member
 
Registered: May 2013
Posts: 86

Rep: Reputation: Disabled
DNS requirements


Hi All,

I have a DNS requirement.

I want to forward the hostname that do not configured in the .zone file to another Bind server to resolve.

example:

I have a zone called example.net.zone. I configured the following in it:

web IN A 10.0.0.1


Now, I can get the ip of web.example.net successfully. but I have another hostname called www.example.net and I don't want it to be resolved by the current Bind server. I want to forward it to an upstream server to resolve. Is this possible ?

Thanks in advance.
 
Old 06-13-2016, 03:25 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,733

Rep: Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584
Hi,

Assuming that your dns is the authoritative for the example.net zone, you can use the following zonefile:
Code:
$TTL 86400      ; 1 day
$ORIGIN example.net.
@               IN SOA  dns.example.net. root.dns.example.net. (
                                1 ; serial
                                28800      ; refresh (8 hours)
                                7200       ; retry (2 hours)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )

                        NS      dns.example.net.
dns                     A       x.x.x.x
web                     A       10.0.0.1

;Define another dns for the host (subdomain) you want:
$ORIGIN www.example.net.
@               NS forward.other-dns.com.
Regards
 
2 members found this post helpful.
Old 06-13-2016, 10:31 PM   #3
hilou
Member
 
Registered: May 2013
Posts: 86

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Hi,

Assuming that your dns is the authoritative for the example.net zone, you can use the following zonefile:
Code:
$TTL 86400      ; 1 day
$ORIGIN example.net.
@               IN SOA  dns.example.net. root.dns.example.net. (
                                1 ; serial
                                28800      ; refresh (8 hours)
                                7200       ; retry (2 hours)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )

                        NS      dns.example.net.
dns                     A       x.x.x.x
web                     A       10.0.0.1

;Define another dns for the host (subdomain) you want:
$ORIGIN www.example.net.
@               NS forward.other-dns.com.
Regards
Thanks a lot first. This is working fine. But I actually just want like 10 domains to be resolved by the current Bind server, and all other(hundreds) will be forwarded to an upstream Bind server. So I have to add them all to config. Do we have a better way ?

Thanks in advance.
 
Old 06-14-2016, 12:45 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,205

Rep: Reputation: 197Reputation: 197
I'm not so familiar with Bind but I think you have to do it manually, unless they are pointing to the same IP Address. I'm not sure though there might be a better way to do it.

If need to be done manually then copy and paste to an editor the existing config, then search and replace the IP or DNS or use some script to automate the changes.

Last edited by JJJCR; 06-14-2016 at 12:45 AM. Reason: edit
 
Old 06-14-2016, 04:41 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,733

Rep: Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584
Quote:
But I actually just want like 10 domains to be resolved by the current Bind server, and all other(hundreds) will be forwarded to an upstream Bind server. So I have to add them all to config. Do we have a better way ?
In this case I'm afraid that you should use the above setup on the upstream dns.
You need to define 10 $ORIGINs for the 10 subdomains you want to delegate to your dns. E.g:
Code:
$TTL 86400      ; 1 day
@               IN SOA  upstream-dns.example.net. root.upstream-dns.example.net. (
                                1 ; serial
                                28800      ; refresh (8 hours)
                                7200       ; retry (2 hours)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )

                        NS      upstream-dns.example.net.
upstream-dns            A       x.x.x.x
www                     A       1.1.1.1
blah                    A       2.2.2.2

;Delegate some hosts to your dns
$ORIGIN one.example.net.
@               NS your.dns.com.
$ORIGIN two.example.net.
@               NS your.dns.com.
<snip>
$ORIGIN ten.example.net.
@               NS your.dns.com.
;finish delegation

;you may add more example.net hosts
$ORIGIN example.net.
foo                     A       3.3.3.3
bar                     A       4.4.4.4
Regards
 
Old 06-14-2016, 08:57 PM   #6
hilou
Member
 
Registered: May 2013
Posts: 86

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
In this case I'm afraid that you should use the above setup on the upstream dns.
You need to define 10 $ORIGINs for the 10 subdomains you want to delegate to your dns. E.g:
Code:
$TTL 86400      ; 1 day
@               IN SOA  upstream-dns.example.net. root.upstream-dns.example.net. (
                                1 ; serial
                                28800      ; refresh (8 hours)
                                7200       ; retry (2 hours)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )

                        NS      upstream-dns.example.net.
upstream-dns            A       x.x.x.x
www                     A       1.1.1.1
blah                    A       2.2.2.2

;Delegate some hosts to your dns
$ORIGIN one.example.net.
@               NS your.dns.com.
$ORIGIN two.example.net.
@               NS your.dns.com.
<snip>
$ORIGIN ten.example.net.
@               NS your.dns.com.
;finish delegation

;you may add more example.net hosts
$ORIGIN example.net.
foo                     A       3.3.3.3
bar                     A       4.4.4.4
Regards
Great idea, but actually the records in the upstream Bind server is also needed, so I cannot update it.

Let's say we have several EVNs, in ENV1 I need web.example.net to be resolved to addr1 and in ENV2 I need it to be resolved to addr2, and I don't want to isolate these two Bind server, in other words, almost 90% records in ENV1 and ENV2 are the same, only 10 percent is not the same.

Regards.
 
Old 06-15-2016, 12:34 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,733

Rep: Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584
Quote:
Let's say we have several EVNs, in ENV1 I need web.example.net to be resolved to addr1 and in ENV2 I need it to be resolved to addr2, and I don't want to isolate these two Bind server, in other words, almost 90% records in ENV1 and ENV2 are the same, only 10 percent is not the same.
You don't say how you distinguish between ENV1 and ENV2, but I guess you may use views for this.
 
Old 06-19-2016, 10:31 PM   #8
hilou
Member
 
Registered: May 2013
Posts: 86

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
You don't say how you distinguish between ENV1 and ENV2, but I guess you may use views for this.
ENV1 and ENV2 are two different environments, let's say ENV1 is Dev and ENV2 is test. Two ENVs want to access a same zone called example.net
 
Old 06-20-2016, 02:47 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,733

Rep: Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584Reputation: 1584
Quote:
Originally Posted by hilou View Post
ENV1 and ENV2 are two different environments, let's say ENV1 is Dev and ENV2 is test. Two ENVs want to access a same zone called example.net
You still don't say how you distinguish between them.
In any case you should use either views (see my previous post), or use different nameservers for ENV1 and ENV2 hosts
 
Old 06-21-2016, 02:43 AM   #10
hilou
Member
 
Registered: May 2013
Posts: 86

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
You still don't say how you distinguish between them.
In any case you should use either views (see my previous post), or use different nameservers for ENV1 and ENV2 hosts
Thank you very much for all the great posts and patience. Really appreciate it.
 
  


Reply

Tags
bind9


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Requirements Zssfssz Mandriva 4 11-14-2011 05:29 AM
PXE server hardware requirements (probably NFS server hardware requirements) Ipolit Linux - Networking 0 07-27-2009 01:33 AM
Win2k3 DNS + PFsense DNS Forwarder = No internal DNS resolution Panopticon Linux - Networking 1 11-19-2007 09:59 PM
K3b Requirements Draiocht Slackware 6 10-02-2005 01:32 PM
Requirements Please figus Linux - General 4 08-31-2002 11:35 AM


All times are GMT -5. The time now is 09:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration