3

Assuming example.com domain and fake IPs, the configuration needed is this:

  • example.com points to 186.200.1.1
  • www.example.com points to 186.200.1.1
  • adm.example.com points to 186.200.1.1
  • online.example.com points to 186.200.1.2
  • store.example.com points to 186.200.1.3
  • *.example.com points to 186.200.1.5

That is, we have two rules:

  1. Subdomains www, adm, online and store have their specific servers.

  2. Any subdomain of example.com, except www, adm, online and store, should point to 186.200.1.5 server.

It's possible archieve that using only DNS records?

Arne Evertsson
  • 185
  • 3
  • 13
Rodrigo
  • 179
  • 3
  • 12

2 Answers2

3

Yes, it is extremely possible! If you add an A record for *.example.com, it will resolve all non-existent domain names to the specified IP address. See: http://en.wikipedia.org/wiki/Wildcard_DNS_record

For example, if your records looked like this:

*.example.com -> 8.8.8.8
a.example.com -> 8.8.4.4

It would mean:

a.example.com resolves to 8.8.4.4
b.example.com resolves to 8.8.8.8
c.example.com resolves to 8.8.8.8

Sub-domains B & C were not specified, which is why they fall back on the wildcard record! :)

Steve
  • 201
  • 1
  • 1
  • 1
    Ok @augrunt, there is a chance that the subdomain `a.example.com` matches with the wildcard rule even if it has own rule? – Rodrigo Feb 14 '14 at 14:57
  • 2
    @Rodrigo As it says in the Wiki article: A wildcard DNS record is a record in a DNS zone that will match requests for **non-existent** domain name. – Steve Feb 15 '14 at 06:06
0

You want to use something like this:

*.example.com.           3600     A     192.0.2.1

It is important that the asterisk is the leftmost sub. The rest of those should be standard A records except for www and adm you could do a CNAME record if you want.

MDMoore313
  • 5,581
  • 6
  • 36
  • 75