By geepie
Can I use two domains with one bind server and one IP address? I have two domains: domainold.com (successfully configured) and domainnew.com.
But every time I try to access domainnew.com, I am redirected to domainold.com instead.
Here is my named.conf.local:
zone "domainold.com" {
type master;
file "/etc/bind/db.domainold.com";
allow-transfer { xxx.xxx.xxx.xxx; };
also-notify { xxx.xxx.xxx.xxx; };
};
zone "domainnew.com" {
type master;
file "/etc/bind/db.domainnew.com";
allow-update { none; };
};
Here is my domainnew.com file:
$TTL 604800
@ IN SOA ns1.domainold.com. admin.domainnew.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.domainold.com.
@ IN NS ns2.domainold.com.
@ IN A 103.121.122.180
;ns1 IN A 103.121.122.180
;ns2 IN A 103.121.122.180
;mx IN A 103.121.122.180
;mail IN A 103.121.122.180
www IN CNAME domainnew.com.
And here is my domainold.com file:
$TTL 604800
@ IN SOA domainold.com. admin.domainold.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.domainold.com.
@ IN NS ns2.domainold.com.
@ IN A xxx.xxx.xxx.xxx
ns1 IN A xxx.xxx.xxx.xxx
ns2 IN A xxx.xxx.xxx.xxx
mx IN A xxx.xxx.xxx.xxx
mail IN A xxx.xxx.xxx.xxx
www IN CNAME domainold.com.
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!
Oops, sorry to add. xxx.xxx.xxx.xxx and 103.121.122.180 are actually same IP address. I forgot to edit the value.
On domainnew.com nameserver settings on my domain management provider, I am using ns1.domainold.com and ns2.domainold.com as nameservers. Is this correct?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.