W
W
web-username2014-02-26 18:30:33
Domain Name System
web-username, 2014-02-26 18:30:33

DNS setting. Domain and subdomain to different IP addresses?

Please tell me how to properly configure DNS - Ubuntu 12.04
There is a domain.com domain, a subdomain name.domain.com now they both work locally, you need to bind domain.com to another external ip address, and leave the subdomain as it is.
In /etc/named/conf
I create two zones
zone "domain.com" {
type master;
file "/etc/bind/domain.com";
allow-transfer { 178.20.158.38; };
also-notify { 178.20.158.38; };
notify yes;
};
zone "name.domain.com" {
type master;
file "/etc/bind/name.domain.com";
allow-transfer { 178.20.158.38; };
also-notify { 178.20.158.38; };
};
178.20.158.38 - NS server of the VPS provider
1.111.11.11 - external ip to which you need to redirect
2.222.22.22 - ip of my server
In /etc/bind/domain.com
$TTL 3600
domain.com. IN SOA domain.com. root.domain.com. (2014022604 10800 3600 604800 86400)
domain.com. IN NS ns1.domain.net.
domain.com. IN NS second.freehost.com.ua.
domain.com. IN MX 10 mail
domain.com. IN MX 20 mail
domain.com. IN A 1.111.11.11
ftp IN A 1.111.11.11
mail IN A 2.222.22.22
pop IN A 2.222.22.22
smtp IN A 2.222.22.22
www IN A 1.111.11.11
domain.com. IN TXT "v=spf1 ip4:2.222.22.22 a mx ~all"
ns1 IN A 2.222.22.22
domain.com is still bound to my server. Please tell me where the error could be. Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vlad Zhivotnev, 2014-02-26
@web-username

In general, for the story:
A person in the config had a construction:
www IN CNAME somewhere
www IN A ip.ad.dr
, while somewhere there without a dot at the end, but this is a lyric.
A CNAME for a domain cannot be used with other record types. Because of this, the zone did not reload (no new changes were applied), and from here the problem appeared) The
config, although it was very strange, was otherwise written correctly. Although there was no point in dividing these two domains into 2 configs.

W
web-username, 2014-02-26
@web-username

Yes. It now works correctly with the ip of the VPS server and the subdomain too, after the edits everything remains as it was.
Do I need to make changes to the Apache settings in this case. (might be a stupid question, I don't know much about it yet)

V
Vitaly Niksenkin, 2014-02-26
@404666

you need to use a dns service any reliable
example obzor.ly/2013/11/kak-podklyuchit-cloudflare
why make NS dependent on your crap vds ? it will fall, hundreds of subdomains will fall on hundreds of Ip addresses

R
Roma, 2014-02-27
@Angel2S2

Why do you need a second zone? The domain is one. I am doing one zone. Here is an example:

IN A		    XXX.YYY.ZZZ.241
www         IN A            XXX.YYY.ZZZ.241
ftp            IN A            XXX.YYY.ZZZ.241
ns             IN A            XXX.YYY.ZZZ.245
mail          IN A            XXX.YYY.ZZZ.244
map		 IN A	    	XXX.YYY.ZZZ.247

Also, do not forget to change serial in the /etc/bind/domain.com file each time the file is changed until bind is restarted:
@               IN SOA  ns.example.ru.      hostmaster.example.ru. (
                        201302101702         ; serial    <<-- !!! ВОТ ЭТО !!!
                        6H                 ; refresh
                        1H                 ; retry
                        3W                 ; expiry
                        300 )              ; minimum TTL

I usually write serial according to the principle YYYYMMDDhhmm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question