Adding a second domain name with Bind9


I’m fairly new to all of this and have been following lots of guides. The guide I followed for this was .

Basically I successfully set up my first domain (domain1) so it points to and 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 “” { type master; file “/etc/bind/zones/”; };

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

zone “” { type master; file “/etc/bind/zones/”; };

; BIND data file for ; $TTL 14400 @ IN SOA ( 201006601 ; Serial 7200 ; Refresh 120 ; Retry 2419200 ; Expire 604800) ; Default TTL ; IN NS IN NS IN MX 10 IN A

ns1 IN A ns2 IN A www IN CNAME mail IN A ftp IN CNAME IN TXT “v=spf1 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!


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 “” { <br>type master; <br>file “/etc/bind/zones/”; <br>}; <br> <br>zone “” { <br>type master; <br>file “/etc/bind/zones/”; <br>};</pre> <br> <br>Now go to /etc/bind/zones and create the find and add the following. ns1 and ns2 are from domain1. <br><pre>; BIND data file for <br>; <br>$TTL 14400 <br>@ IN SOA ( <br>201006601 ; Serial <br>7200 ; Refresh <br>120 ; Retry <br>2419200 ; Expire <br>604800) ; Default TTL <br>; <br> IN NS <br> IN NS <br> <br> IN MX 10 <br> IN A <br> <br>ns1 IN A <br>ns2 IN A <br>www IN CNAME <br>mail IN A <br>ftp IN CNAME <br> IN TXT “v=spf1 a mx ~all” <br>mail IN TXT “v=spf1 a -all”<pre>

zone “” { <br>type master; <br>file “/etc/bind/zones/”; <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.