问题原文
原帖链接 · Rodrigo · CC BY-SA 4.0
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:
Subdomains www, adm, online and store have their specific servers.
Any subdomain of
example.com, except www, adm, online and store, should point to186.200.1.5server.
It's possible archieve that using only DNS records?
已采纳解答
原帖链接 · Steve · CC BY-SA 3.0
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! :)
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
