1

For a home setup I only have 1 public IPv4. So I have to use it for all my hosts. Luckily I have only one. So in the DNS I use the at sign @ to define the origin, example.com with an A record where I put the IPv4.

That works fine, but for the mail server I need the reverse DNS to match the name of the MX. In this case the reverse for this IP is the origin, example.com. So I can't setup something different like mail.example.com since it won't match the reverse DNS.

Can I use the origin, example.com as an MX so the reverse points to the right host? and how?

Can I do something like:

@ 10800 IN MX 5 @
2

A freestanding at sign is simply a shorthand for the current origin name, so that should work. It does look rather confusing, though, so you may want to spell out the name instead just to make your intent clearer to whoever will read the zone file in the future (even if that someone is yourself in a couple of years' time).

2
  • Thanks, right now I am testing this setup on gandi.net's DNS. AFAIK they use Bind 9 and when I try to put the name instead of @ I get an error that this already exists. I have read somewhere that by default, if nothing is specified, the MX of a zone is its origin so maybe that's why. But I'm not sure and can't find authoritative information on the subject. Right now it is working with @ but I would like to know if it's the way to go and if mail servers won't get confused.
    – Bastian
    Jan 8 '16 at 11:40
  • The @-sign is purely a zone file thing, that gets replaced by an actual name when a name server loads the file. Mail servers looking at MX records never see it. And there can certainly be many MX records for the same name. Why Gandi gives you an error I cannot say, since I've never used them. Jan 8 '16 at 16:18

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.