Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have: - two DNS servers: 1.1.1.1 and 2.2.2.2 - domain name: domain.com pointed to 1.1.1.1

I want to point sub domain: sub.domain.com to 2.2.2.2 (obviously www.sub.domain.com too)

on 1.1.1.1 I've create a DNS A record pointing sub.domain.com to 2.2.2.2

accessing sub.domain.com now lead to 2.2.2.2 successfully

the problem is the DNS records on 2.2.2.2 such as CNAME www do not work means accessing www.sub.domain.com DNS lookup results to: domain does not exist.

what should I do in order to be sure that all sub.domain.com sub-domains and alias are managed by 2.2.2.2?

Your help is appreciated, thank you.


Update 1

@Tonin: yes, I'm looking to delegate the zone.

look to what I did:

on 1.1.1.1 I've set the zone:

sub.domain.com  A  2.2.2.2
                NS 2.2.2.2

on 2.2.2.2 I've set the zone:

www  CNAME  base (sub.domain.com)
mail A      2.2.2.2

DNS lookup of sub.domain.com is correct DNS to www.sub.domain.com or other records do not lead to the intended results (Non-Existent Domain!)

share|improve this question

2 Answers 2

It is not very clear from your question if you want to actually delegate the zone to 2.2.2.2 or if you just want to use the www.sub.domain.com name (and any other name in that sub-domain) as an alias to sub.domain.com. In the first case, you should properly delegate the sub zone to 2.2.2.2 like that:

sub A  2.2.2.2
    NS 2.2.2.2

And then define the sub.domain.com zone on 2.2.2.2 and add as many records you want. But I'd not recommend that, I'd recommend to have both servers actually serve the whole domain.com zone, so you have fail-over.

That brings us to the second case, where you can simply create a CNAME for the www.sub.domain.com entry pointing to sub, like (in the domain.com zone):

sub A 2.2.2.2 ; you already have that one
www.sub CNAME sub

And if you want all names bellow sub to redirect to the same host, you can as well define a wildcard entry. Providing the domain.com zone is served by both DNS, you end up having a zone like:

@ IN SOA ....
     NS ns
     NS sub
ns  A 1.1.1.1
sub A 2.2.2.2
*.sub CNAME sub
share|improve this answer
    
I'm looking to delegate the zone. –  Maxy Aug 6 '12 at 22:18
    
Then the first part of my answer should be what you're looking for (A and NS point to 2.2.2.2). And you define the sub.domain.com zone on 2.2.2.2 and put inside it whatever you want and redefine a second time the A record so both servers know about it. Also, have a look at DNS utilities to spot what your servers are actually answering (dig @1.1.1.1 or dig @2.2.2.2). –  Tonin Aug 6 '12 at 22:26
    
on 1.1.1.1 I've set the zone: sub.domain.com A 2.2.2.2 NS 2.2.2.2 on 2.2.2.2 I've set the zone: www CNAME 2.2.2.2 mail A 2.2.2.2 DNS lookup of sub.domain.com is correct DNS to www.sub.domain.com or other records do not lead to the intended results –  Maxy Aug 6 '12 at 22:27
    
A CNAME should point to a name, not an IP. If you have mail A 2.2.2.2 then simply add www CNAME mail to your zone. –  Tonin Aug 6 '12 at 22:29
    
my bad, the CNAME is done through a domain not IP, although it's not working as I claimed. –  Maxy Aug 6 '12 at 22:48

On 1.1.1.1 the NS record must point to 2.2.2.2, not A record. SOA, NS and all other wanted records for subdomains must be on 2.2.2.2

$ host -a routerz.ru. a.dns.ripn.net.
Trying "routerz.ru"
Using domain server:
Name: a.dns.ripn.net.
Address: 193.232.128.6#53
Aliases:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49187
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 4

;; QUESTION SECTION:
;routerz.ru.                    IN      ANY

;; AUTHORITY SECTION:
routerz.ru.             345600  IN      NS      ns2.reg.ru.
routerz.ru.             345600  IN      NS      ns1.reg.ru.

;; ADDITIONAL SECTION:
ns1.reg.ru.             345600  IN      A       31.31.204.52
ns1.reg.ru.             345600  IN      A       31.31.204.37
ns2.reg.ru.             345600  IN      A       31.31.204.25
ns2.reg.ru.             345600  IN      A       213.183.59.77

Received 132 bytes from 193.232.128.6#53 in 63 ms

$ host -a routerz.ru. ns2.reg.ru.
Trying "routerz.ru"
Using domain server:
Name: ns2.reg.ru.
Address: 31.31.204.25#53
Aliases:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25240
;; flags: qr aa rd; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;routerz.ru.                    IN      ANY

;; ANSWER SECTION:
routerz.ru.             43200   IN      A       46.4.85.21
routerz.ru.             43200   IN      NS      ns2.reg.ru.
routerz.ru.             43200   IN      NS      ns1.reg.ru.
routerz.ru.             43200   IN      SOA     ns1.reg.ru. hostmaster.ns1.reg.ru. 1278493922 14400 3600 604800 21600
routerz.ru.             43200   IN      MX      15 gw31.eholod.ru.
routerz.ru.             43200   IN      MX      25 gw21.eholod.ru.

Received 180 bytes from 31.31.204.25#53 in 46 ms
share|improve this answer
    
You mean in 1.1.1.1 create a zone for sub.domain.com, within, create an NS record to 2.2.2.2 then in 2.2.2.2 I manage the records for sub.domain.com (MX, CNAME...) –  Maxy Aug 6 '12 at 21:17
    
I newer do it self. But look at DNS replies for other domains... –  mmv-ru Sep 14 '12 at 13:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.