When configuring a BIND DNS zone, I often wonder why there exists both @ and * to specify an alias for the zone name. Is there a difference between the two?
| |||
|
feedback
|
|
Here is an example of how I use these two symbols in a zone file:
In this example I'm defining the zone for EXAMPLE.NET using EXAMPLE.COM's DNS servers. I have 2 IP addresses which I assign to A records for domain so EXAMPLE.NET points to both 192.168.1.212 and 192.168.1.214. I then define a couple of CNAME records, www and the magical So you could actually translate this zone file to be:
Both versions are identical. The | |||||||
feedback
|
|
In addition to what Bill Weiss said i would like to point out that
and a.EXAMPLE.NET will return 1.2.3.4 just like c.EXAMPLE.NET will 8.8.8.8 Also a.a.a.c.EXAMPLE.NET will return 8.8.8.8 as well which is just what makes wildcard records a bit messy. You can potentially use up all the cache of an recursive nameserver by iterating over these names. | |||
|
feedback
|
|
Think of @ as a macro which is expanded during the parsing of the zone files while * is an operator which "globs" (matches) anything which hasn't matched any of the normal entries. The * entry allows one to configure a DNS to return the specified records for queries which would otherwise get an "NXDOMAIN" (non-existent) response. | |||
|
feedback
|
|
"@" expands to the current $ORIGIN, per RFC 1035. I've seen this most often in the SOA record at the top of zone file. I've never seen '*' used for anything but to match anything not previously matched in RR entries (aka "wildcard" entries). | |||
|
feedback
|