0

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

3 Answers3

1

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
Shadok
  • 623
  • 5
  • 10
  • I can't do this way because blah is not only subdomain. I have over 9000 of them pointing to one IP. –  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. –  Jan 25 '11 at 02:59
0

Did you try dl1.@ ?

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

I cannot test it.

lg.
  • 4,649
  • 3
  • 21
  • 20
  • 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) –  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
0

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.

gelraen
  • 2,341
  • 20
  • 19
  • 1
    I can't agree with your suggestion to write a custom DNS server. – Nic Jan 25 '11 at 06: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 09:18