DNS Zone file wildcard preference

July 30, 2014 2.5k views

I manage my DNS settings for a domain through digital ocean. I have the following entries.


So all subdomains route to unless I specify a specific DNS entry.

I decide to add another subdomain


I try pinging pear.example.com and it still resolves to

In my Zone file * is listed above pear

apple   IN A
orange  IN A
*       IN A
pear    IN A

which makes me wonder if the DNS check is matching * before it even gets a chance to see pear? For another domain, I deleted the * entry and then added it back to the end of the list and it solved my issue, but that seems a bit of a bodge to me?

Am I doing anything wrong?


3 Answers

Solved it myself. Turned out the solution was not to be an impatient moron.

Specific DNS A records always take preference over a wildcard entry

  • Should have refreshed the page, and I would have seen that you already figured it out! Good to know everything is working as expected!

As I understand the RFC (see 2.7 Wildcard records), wildcards should only match records that aren't defined in the zone file. Is it possible that the DNS records simply hadn't completely propagated yet?

Yeah that was exactly it. I've updated DNS entries in the past and seen the results elsewhere in minutes, but (as every DNS provider will ever tell you) I should allow for a bit longer.


Have another answer? Share your knowledge.