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

I have a * wildcard subdomain pointing to 1.1.1.1. How can I describe a sub-subdomains dl1 and dl2 (pointing to 2.2.2.2 and 3.3.3.3) of this? For example, dl1.blah.example.com must point to 2.2.2.2

Here is my zonefile:

$TTL 3600
example.com.    IN    SOA    ns2.mydns.com.    root.example.com.    (
20100521    ; Serial
10800        ; Refresh
3600        ; Retry
604800        ; Expire
86400    )    ; Minimum TTL

@        IN    NS    ns2.mydns.com.
@        IN    NS    ns1.mydns.com.
@        IN    A     1.1.1.1
@       IN      MX      10      mymail.com.
dl1     IN      A       2.2.2.2
dl2     IN      A       3.3.3.3
*        IN     A    1.1.1.1
share|improve this question
    
I'm configuring PowerDNS now, hope it'll help me. –  user46909 Jan 25 '11 at 3:00
    
This scenario is invalid according to RFC 4592, "The Role of Wildcards in the Domain Name System." –  Nic Jan 25 '11 at 6:36
    
But PowerDNS supports Perl backends, I'll write mine. –  user46909 Jan 25 '11 at 13:39

3 Answers 3

I'd say you have to add those records:

dl1.blah    CNAME   dl1.
dl2.blah    CNAME   dl2.

Those will worked because dl1.example.org already points to 2.2.2.2 ; if you want to change this last record you'll have to modify the two answers I gave you this way:

dl1.blah    A   2.2.2.2
dl2.blah    A   3.3.3.3
share|improve this answer
    
I can't do this way because blah is not only subdomain. I have over 9000 of them pointing to one IP. –  user46909 Jan 24 '11 at 17:14
    
why can't you do that? Just cos there's 9000 of them doesn't mean it wouldn't work... –  Alnitak Jan 24 '11 at 21:33
    
I sure this will work, but describing all the subdomains is a big job, even in automated matter. –  user46909 Jan 25 '11 at 2:59

Did you try dl1.@ ?

dl1.@   IN   A    2.2.2.2 
dl2.@   IN   A    3.3.3.3

I cannot test it.

share|improve this answer
    
Did not worked. Error in named configuration: example.com.conf:39: dl1.\@.example.com: bad owner name (check-names) zone example.com/IN: loading master file example.com.conf: bad owner name (check-names) _default/example.com/IN: bad owner name (check-names) –  user46909 Jan 24 '11 at 17:49
    
@ can only be used as a whole entry, not as a suffix. Omitting the trailing . automatically adds the value of @ so there's no need for an explicit syntax for it. –  Alnitak Jan 24 '11 at 21:33

It seems that RFC 1034 does not describe, neither BIND does not implement such wildcards. So you can use blah.dl1.example.com. domain or write small custom "DNS-server" which will respond with correct IP addresses.

share|improve this answer
1  
I can't agree with your suggestion to write a custom DNS server. –  Nic Jan 25 '11 at 6:28
    
Why? It must not be a full-featured server, just responder, which returns needed RRs for these names. Better even to not show it directly to outer world, but hide it behind caching DNS server (i.e. BIND have zone {type forward;} for this) –  gelraen Jan 25 '11 at 9:18

Your Answer

 
discard

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