1760540 Members
2839 Online
108894 Solutions
New Discussion юеВ

DNS questions

 
SOLVED
Go to solution
Sean OB_1
Honored Contributor

DNS questions


Is it possible to setup a DNS server to so that it resolves servers in two domains without having to manually keep two zones?

For example if I have machines A1, A2, A3

I want them to resolve as

A1.dom1.com & A1.dom2.com
A2.dom1.com & A2.dom2.com

Could I create one generic zone file and then just point both domains to that zone file?

IE:

db.generic

named.conf:


zone "dom1.com" {
type master;
file "/etc/namedb/db.generic";
};

zone "dom2.com" {
type master;
file "/etc/namedb/db.generic";
};



What kind of gotchas would I encounter if I did this?

8 REPLIES 8
Vinit Adya
Frequent Advisor

Re: DNS questions

Hi,
I am not very clear of the objective.
why do you really need 2 zones?
Alias could work if for certain things. (on client side)
I Dont think the config you have proposed above is a valid one.
Sean OB_1
Honored Contributor

Re: DNS questions

I need two zones because the company has two domains that they need to continue using.

So now there is manual replication of some machines between the zones, but some aren't in both.

So it's hit or miss if a.dom1.com will resolve or a.dom2.com.

Jordan Bean
Honored Contributor
Solution

Re: DNS questions


Yes, you can do that. The only gotcha: Don't use dynamic updates. Any changes must be manually committed and the name server restarted (or the affected zones reloaded).

Kellogg Unix Team
Trusted Contributor

Re: DNS questions

Yes, its possible to setup 2 different domains with a comon zone file. Make sure that in your zone file, you do not put any reference for either dom1 or dom2 (use @ instead). Another thing to keep in mind is that the reverse resolution will "only" resolve to one of the domains.

This method is generally used when transitioning from old domain to a new one and you want to run both domains parallely for some time.
work is fun ! (my manager is standing behind me!!)
Sean OB_1
Honored Contributor

Re: DNS questions

How would I setup the SOA record?

Here is what I have now:

@ IN SOA mail.domain1.com. root.domain1.com. (
2002082901 ; Serial
28800 ; Refresh
7200 ; Retry
604800 ; Expire
86400 ; Minimum
)
Kellogg Unix Team
Trusted Contributor

Re: DNS questions

If reverse lookups return "domain1.com", I will keep the file as such. I had tested this setup with BIND 8.2 and it worked fine. What version of BIND are you running? I haven't worked on BIND 9.x yet.
work is fun ! (my manager is standing behind me!!)
Sean OB_1
Honored Contributor

Re: DNS questions

We are running 8.2.2. I setup a couple of test domains and pointed them to a combined zone file and it seems to work fine.

On the reverse zone right now everything is setup with a FQDN. Can I setup that up with just the hostname for each entry as well?

Now it has:
11.4 IN PTR m1601a.domain1.com.
8.5 IN PTR m6500cr1-north.domain1.com.
8.6 IN PTR m6500cr1-south.domain1.com.
8.7 IN PTR m6500cr1-west.domain1.com.

Can I have:

11.4 IN PTR m1601a
8.5 IN PTR m6500cr1-north
8.6 IN PTR m6500cr1-south
8.7 IN PTR m6500cr1-west


TIA
Kellogg Unix Team
Trusted Contributor

Re: DNS questions

>Can I have:
>
>11.4 IN PTR m1601a
>8.5 IN PTR m6500cr1-north
>8.6 IN PTR m6500cr1-south
>8.7 IN PTR m6500cr1-west

Technically, yes. But not in the above format; otherwise while doing reverse lookup, you'll get the result like -

Name: m1601a.11.4.in-addr.arpa
Address: x.y.4.11

Make sure the records are in the foll. format -

11.4 IN PTR m1601a.
8.5 IN PTR m6500cr1-north.
8.6 IN PTR m6500cr1-south.
8.7 IN PTR m6500cr1-west.

(note the period after each record; can be done via a shell script)

In this scenario, you will have to test your apps; most of them only do forward mapping but if any of your application does reverse mapping as well, it will find a mismatch between 2 outputs and may fail to work (e.g. nslookup on "m1601a.dom1.com" returns "x.y.4.11" but reverse lookup on "x.y.4.11" will return "m1601a" only).

Yes, its do-able. :-)
work is fun ! (my manager is standing behind me!!)