2

If one adds a Wildcard subdomain entry in the DNS Zone, for example:

*.example.com. 3600 IN A <Some IP>

How much of a query for say somerandomsubdomain.example.com be cached? After some research I did find out that example.com will be cached at various points and thus my DNS server can directly query example.com DNS server for the subsequent anotherrandom.example.com.

But do Servers/routers/OS while caching also cache that *.example.com is a wildcard entry and hence all future queries for other random subdomains of example.com be resolved immediately?

2 Answers 2

6

Wildcard expansion happens on the authoritative nameservers only, so the wildcard record itself will never be cached. (For one thing, you need to have all the normal records on hand to know for which names a wildcard actually applies.)

Various records resulting from the expansion of the wildcard can be expected to be cached, though.

Eg, if a query has been made for foo.example.com. IN A and this was found to match the wildcard *.example.com. 3600 IN A 192.0.2.1 the resulting answer foo.example.com. 3600 IN A 192.0.2.1 can (probably will) be cached.

1

Servers can only cache the wildcard part, if the can do zone transfers. Which they only tend to do, if they belong to one organisation (or different organisations working closely together).

If they don't use zone transfers, they do forward lookups (your router will most certainly only do that). In that case, they only get a reply that will look exactly as it would if the record had been explicitly defined, for example:

notdefined.example.com    60168    IN    A    <someip>

Even if they would get a return like

*.example.com    60168    IN    A    <someip>

they would still have to look up every other record for example.com, since any explicitly defined record takes precedence over the wildcard one. I.e:

*.example.com.   3600 IN  A <Some IP>
www.example.com.   3600 IN  A <Some IP2>
ftp.example.com.   3600 IN  A <Some IP3>

would be valid. Sources: RFC 4592 and RFC 1034

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .