CNAME / MX has zone appended to hostname

Hi,
I am using a custom delegated domain and try to add cname and mx records with a target outside of the zone the entry is created in. However when using REST or the Web UI there is always appended the zone to the entered hostname.
Let’s assume I have the zone test.example.com. When adding a CNAME record with the name abc and set something.example.com as data then the entry is always created as abc.test.example.com CNAME something.example.com.test.example.com

I tried this with single zone and multiple zone domains. Ist this expected behaviour or a bug?

Thanks,
Martin

1 Like

I experience the same behavior also with MX records. I hope this is just a bug since setting external MX Servers is a widespread use case.

Kind regards
Moritz

Hey, sorry for letting you hang there, I was on vacation (technically, still am :slight_smile:)

MX and CNAME data fields are interpreted as host names, and they can come in two flavors:

  • unqualified, like test.example.com, and
  • qualified, like test.example.com. (note the trailing dot being part of the name).

Our systems will always prefix unqualified names to the zone they live in (and hence become qualified), while fully qualified names are not touched.

Think of this distinction as the same as relative and absolute path names (./path/to/x vs. /path/to/x on unixoid systems and .\path\to\x vs. C:\path\to\x on Windows systems; here the leading dot indicates a relative path, though).

See also:

tl;dr

To get something.example.com as MX record for the test.example.com zone, you need to add the trailing dot to the record’s data, resulting in something.example.com..

1 Like

Thank you for the clarification. I don’t know why I did think of this myself. I don’t manage DNS on a daily basis but being a sysadmin professionally it’s a bit embarrassing that this didn’t come to mind :sweat_smile:
And no worries about the “delay”. Happy remaining vacation! :slightly_smiling_face:

1 Like