Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

On import, it appended my domain name to all the CNAME records #39

Closed
treeder opened this Issue September 10, 2012 · 7 comments

4 participants

Travis Reeder Barnaby Gray Amir Salihefendic Jeremy Dunck
Travis Reeder

If this was in the zone file:

gdocs   3600    IN  CNAME   ghs.google.com

It ended up like this in Route 53:

ghs.google.com.mydomain.com.
Amir Salihefendic

I can confirm this bug as well :-/

Barnaby Gray
Owner

I can confirm this is a bug.. in your zone files! ;)
Records must be terminated with a period, otherwise they are relative records.
See:
http://tools.ietf.org/html/rfc1033
"Domain names in the zone files can be one of two types, either
absolute or relative. An absolute name is the fully qualified domain
name and is terminated with a period. A relative name does not
terminate with a period, and the current default domain is appended
to it. The default domain is usually the name of the domain that was
specified in the boot file that loads each zone."

Barnaby Gray barnybug closed this September 10, 2012
Travis Reeder

hmmm, ok, well that's direct export from GoDaddy. Perhaps you could at least supply a flag that would not append the domain like import --no-append or something.

Barnaby Gray
Owner

Suggest either manually fix file or running perl over the GoDaddy export to fix, this should do the trick:
perl -pe 's/(CNAME .+)(?!.)$/$1./i' broken.txt > fixed.txt

I'll add a note to the README.

Jeremy Dunck

FWIW, I had this same issue exporting from one account's route53 and importing to another. I checked my source zonefile (not the export from cli53 export, but the route53 api response) and confirmed it was missing the period. It turns out to be my fault: I have cnames without the trailing period -- which have worked, apparently, all this time, despite being wrong.

I'd suggest changing the readme (which I read, but skipped the relevant section due to GoDaddy mention) to instead note that it's useful to check whether exported cnames are defined correctly (that is, with either a trailing period or intentionally relative).

Jeremy Dunck

Also, the regex is not quite right - it didn't allow for hostnames with hyphens:
perl -pe 's/(CNAME\s+[-a-zA-Z0-9.-]+)(?!.)$/$1./i'
rather than
perl -pe 's/(CNAME\s+[a-zA-Z0-9.-
]+)(?!.)$/$1./i'

Barnaby Gray
Owner

Please sent patch to docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.