Question

Adding a second domain name with Bind9

Hello!

I’m fairly new to all of this and have been following lots of guides. The guide I followed for this was http://www.servermom.org/how-to-install-and-setup-bind9-on-ubuntu-server/136/ .

Basically I successfully set up my first domain (domain1) so it points to ns1.domain1.com and ns2.domain1.com and works perfect.

When I went to set up my second domain (domain2) I added it to my /etc/bind/named.conf.local file with this code:

zone “domain2.com” { type master; file “/etc/bind/zones/domain2.com.db”; };

Then I went to edit the db file which is this code:

zone “wakeupontop.com” { type master; file “/etc/bind/zones/wakeupontop.com.db”; };

; BIND data file for domain.com ; $TTL 14400 @ IN SOA ns1.domain.com. host.domain.com. ( 201006601 ; Serial 7200 ; Refresh 120 ; Retry 2419200 ; Expire 604800) ; Default TTL ; domain.com. IN NS ns1.domain.com. domain.com. IN NS ns2.domain.com.

domain.com. IN MX 10 mail.domain.com. domain.com. IN A xxx.xxx.xxx.xxx

ns1 IN A xxx.xxx.xxx.xxx ns2 IN A xxx.xxx.xxx.xxx www IN CNAME domain.com. mail IN A xxx.xxx.xxx.xxx ftp IN CNAME domain.com. domain.com. IN TXT “v=spf1 ip4:xxx.xxx.xxx.xxx a mx ~all” mail IN TXT “v=spf1 a -all”

My question is… How do I edit the DB file. Where do I put domain2 and domain1?

I really appreciate the help!

Matt


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Check your /etc/bind/named.conf.local file and in the zones section make it look like this. <br><pre>zone “domain1.com” { <br>type master; <br>file “/etc/bind/zones/domain1.com.db”; <br>}; <br> <br>zone “domain2.com” { <br>type master; <br>file “/etc/bind/zones/domain2.com.db”; <br>};</pre> <br> <br>Now go to /etc/bind/zones and create the find domain2.com.db and add the following. ns1 and ns2 are from domain1. <br><pre>; BIND data file for domain2.com <br>; <br>$TTL 14400 <br>@ IN SOA ns1.domain1.com. host.domain1.com. ( <br>201006601 ; Serial <br>7200 ; Refresh <br>120 ; Retry <br>2419200 ; Expire <br>604800) ; Default TTL <br>; <br>domain2.com. IN NS ns1.domain1.com. <br>domain2.com. IN NS ns2.domain1.com. <br> <br>domain2.com. IN MX 10 mail.domain2.com. <br>domain2.com. IN A xxx.xxx.xxx.xxx <br> <br>ns1 IN A xxx.xxx.xxx.xxx <br>ns2 IN A xxx.xxx.xxx.xxx <br>www IN CNAME domain2.com. <br>mail IN A xxx.xxx.xxx.xxx <br>ftp IN CNAME domain2.com. <br>domain.com. IN TXT “v=spf1 ip4:xxx.xxx.xxx.xxx a mx ~all” <br>mail IN TXT “v=spf1 a -all”<pre>

zone “wakeupontop.com” { <br>type master; <br>file “/etc/bind/zones/wakeupontop.com.db”; <br>}; <br> <br>that is not in the DB code… I accidentally put that on my post :\ cant figure out how to take it off.