92

I have the following data in my DNS zone file for my domain:

$ORIGIN mydomain.com.
@       IN      A       208.X.Y.Z
mail    IN      A       208.X.Y.Z
... etc..

What does the @ line mean? I know what an A record is.. but a host with an ampersand at sign?

  • 7
    A little nitpicky perhaps but @ is not an ampersand. ;) – John Gardeniers Nov 12 '09 at 6:40
  • 1
    HAHAH oooops :) That's so true .... time to fix that up.. (donno why i said it's an ampersand / & ) .. .... – Pure.Krome Nov 12 '09 at 22:42
64

RFC 1035 defines the format of a DNS zone file.

... on page 34 you'll find:

@ A free standing @ is used to denote the current origin.

This means that @ is a shortcut for the name defined with $ORIGIN.

You can find more information on $ORIGIN here, which is an excerpt from Pro DNS and BIND, published by Apress.

42

It's the root, or in your example it's mydomain.com.

  • It doesn't seem to be equivalent when I try it out. I made an A record for mydomain.com. pointing to my host's IP. This makes a DNS lookup fail with the error that it couldn't resolve the hostname. If I change the mydomain.com. to @, the domain resolves and my website becomes reachable. What is the difference between the two? I assume the zone isn't mydomain.com? (I'm setting these records in the Namecheap control panel). – Daniel Saner Oct 11 '15 at 19:16
  • @DanielSaner The part to put before the IN is the prefix before mydomain.com. So if you put mydomain.com, that really means mydomain.com.mydomain.com. So that's why the @ is an important character which translates simple to mydomain.com. – Scott Forsyth - MVP Oct 12 '15 at 3:47
  • My understanding was that the trailing . designates the name as fully qualified, so the origin shouldn't be appended. That would be according to RFC 1535, and it's in fact the way my registrar uses it in their examples: namecheap.com/support/knowledgebase/article.aspx/9256/29/… But such a configuration doesn't work when I try it. Maybe the control panel does something else than just add the information to the zone as-is? – Daniel Saner Oct 12 '15 at 10:07
  • 1
    Yeah, much of that is up to the implementation of the DNS tool. You'll see the @ when you work with the DNS files directly, but you'll rarely see it in the various DNS tools. The DNS tools try to simplify the UI. From your messages it sounds like you have it working one way but not another so I recommend going with the way that it does work. DNS tools are really up to the implementation of the tool, and even DNS servers may not implement this the same way according to specs. – Scott Forsyth - MVP Oct 12 '15 at 15:29
  • So to summarise, for a properly working DNS server, @ and domain.com. should be equivalent? – CMCDragonkai Dec 23 '16 at 12:38
5

It's an alias for the zone name itself. In this case, it indicates that the zone name has that address (or mx record, or ...)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.