Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue creating subdomains with Bind 1

Status
Not open for further replies.

Harime

ISP
Jun 6, 2016
4
EU
Hello!

Thanks in advance for any help you can give me.

At work, I have a DNS structure, let´s call it domain "abc.corp", where we have a master and a slave DNS servers running Red Hat and Bind.

We want now to differentiate WiFi and Wired users, so we thought about creating "wifi.abc.corp" and "wired.abc.corp". To make this easier, we have created two separate files to hold the records (db.wired.acb.corp and db.wifi.abc.corp").

I tried to do this with the "$INCLUDE" statement in "db.abc.corp" where the main registers are, but the BIND process itself substitutes my "$INCLUDE" for a "$ORIGIN" and integrates my subdomain records in the main DNS database. If this goes this way, there is no way for me to dinamically add registers to the subdomain databases and have them work.

Any ideas or advise on how could I do this in a cleaner way?

Thanks!
 
If your BIND recognizes the configuration and serves as authoritative server for both domains then it's just a matter of making sure the updates are allowed. Each zone file needs to have a configuration line doing just that.
 
Hello,

Thanks for the reply.

I'm not sure if I have explained my issue correctly.

I have the following structure:

Domain: abc.corp
Sub-domains: wifi.abc.corp, wired.abc.corp
Register files: db.abc.corp, db.wifi.abc.corp, db.wired.abc.corp

When I try to include (via '$INCLUDE /var/named/db.wifi.abc.corp') the files where the registers for the sub-domains are, what the system does it take the information out of the sub-domain file, incorporate it into the parent file (db.abc.corp), remove my "include" and keep working that way.

This way, I cannot have my sub-domain registers in separate files, or have registers added to the "db" files and make them work. Any further changes are not accepted by the DNS server because my "INCLUDE" is gone.

Is there a way to have a structure like this and make it work dynamically? I would like to be able to edit the subdomain files separately and have it work.

Thank you.
 
I see. I do not think you can "include" what you call register files. You can include files that have references to to those, for example:
in the named.conf:

options {
directory "/var/named";
....
}
....
include "/etc/wifi.abc.corp";

then, in the /etc/wifi.abc.corp file you would have the zone itself:

zone "wifi.abc.corp." IN {
type master;
file "data/db.wifi.abc.corp";
allow-update { <your code here>; };
allow-transfer { none; };
check-names ignore;
};

place the db.wifi.abc.corp in /var/named/data and make it chown named.named <file name>, or root.named with group write for named, for dynamic updates.
 
Thanks! It seems we made it work with the zones like you said.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top