问题原文
原帖链接 · Basj · CC BY-SA 4.0
I have read Multiple wildcard dns entries and know the limitations/drawbacks of wildcard DNS entries, but I have a question about the order in which it is listed by my registrar:
example.com A 192.0.2.1 (1)
test.example.com A 192.0.2.2 (2)
*.example.com A 192.0.2.3 (3)
test2.example.com A 192.0.2.4 (4)
More precisely:
Am I correct that (3) won't impact (1) and so the only A record for
example.comis (1)?Is rule (2) overriden by rule (3), or will both rules apply for
test.example.com(thus two A records for this subdomain)?As (4) is listed after (3), does this mean
test2.example.comwill have only one A record (192.0.2.4) or two A records (both192.0.2.3and192.0.2.4)?
已采纳解答
原帖链接 · Stuggi · CC BY-SA 4.0
- Wildcards do not apply to the root record of the domain, so (1) will be the only A record for
example.com - The key point about wildcards is that they only apply for otherwise non-existent subdomains, so any queries for
test.example.comandtest2.example.comwill be answered by (2) and (4) respectively. - As I stated above, wildcards do not apply to explicitly stated subdomains, so it doesn't really matter, but DNS generally does not care about the order of records in a zone (there are some exceptions, like where the SOA record should be, and round-robin records).
So to sum it all up, only if a query comes in for let's say foobar.example.com will it be matched with your wildcard record.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
