Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNAME records are returned as NXDOMAIN #48

Closed
Yannik opened this issue Mar 2, 2018 · 12 comments
Closed

CNAME records are returned as NXDOMAIN #48

Yannik opened this issue Mar 2, 2018 · 12 comments

Comments

@Yannik
Copy link
Contributor

Yannik commented Mar 2, 2018

I'm using <uid>.acme-dns.mydomain.org for the letsencrypt TXT records and would like to use acme-dns.mydomain.org as API endpoint.

These are the records I've configured in config.cfg:

records = [ 
    "acme-dns.mydomain.org. CNAME hostname.mydomain.org",
    "acme-dns.mydomain.org. NS hostname.mydomain.org",
]

In the mydomain.org zone I have configured acme-dns.mydomain.org NS hostname.mydomain.org accordingly.

Unfortunately, querying acme-dns.mydomain.org results in NXDOMAIN:
time="2018-03-02T11:45:27Z" level=debug msg="Answering question for domain" domain=acme-dns.mydomain.org. qtype=A rcode=NXDOMAIN

Is it possible to get CNAMEs to resolve correctly? I'd really prefer this over hardcoding an A-record.

@MrBMT
Copy link

MrBMT commented Mar 2, 2018

acme-dns will not serve any DNS records other than those explicitly set in the records section, or the TXT records added via the API.

What you're tying to do here won't work, so you'll need to add an A record for it instead.

@Yannik
Copy link
Contributor Author

Yannik commented Mar 2, 2018

Well, I did set the CNAME record using the records section.
acme-dns just needs to return the CNAME, it does not have to recursively resolve that if that's what you are thinking about.

(In fact, the ADDITIONAL section is only ever added if the CNAME target is in the same zone by most DNS servers.)

@Yannik
Copy link
Contributor Author

Yannik commented Mar 2, 2018

As per rfc 1034:

CNAME RRs cause special action in DNS software.  When a name server
fails to find a desired RR in the resource set associated with the
domain name, it checks to see if the resource set consists of a CNAME
record with a matching class.

@Yannik
Copy link
Contributor Author

Yannik commented Mar 2, 2018 via email

@Yannik Yannik closed this as completed Mar 2, 2018
@MrBMT
Copy link

MrBMT commented Mar 2, 2018

Oops, sorry; I actually misread what you posted. Re-read it just now and realised I'd done a dumb. Good stuff on the PR.

joohoi added a commit that referenced this issue Mar 13, 2018
return cname if requested RR was not found and cname exists (fixes #48)
@Queuecumber
Copy link

Is there some trick to making this work? I wanted to use a similar setup but when I try to dig acme-dns.mydomain.org. I just get back the CNAME record, it doesn't resolve to an A. As far as I can tell I have all the other records set up

@Yannik
Copy link
Contributor Author

Yannik commented Aug 14, 2018

@Queuecumber That's normal. Dig does return the response (which is the CNAME target). Your operating system will resolve the CNAME target by querying the DNS server of the cname target. Try ping acme-dns.mydomain.org. That correctly show the ip.

@joohoi
Copy link
Owner

joohoi commented Aug 14, 2018

@Yannik please refer to https://github.com/joohoi/acme-dns#dns-records and note that you need to add the A record for acme-dns.mydomain.org to the acme-dns config.cfg records variable as well, as shown in the default config.cfg.

@Yannik
Copy link
Contributor Author

Yannik commented Aug 14, 2018

@joohoi while that may be used in the default configuration, I definitely do not have any A records in my config.cfg records. (I've been actively using acme-dns with this setup for a long time)

@joohoi
Copy link
Owner

joohoi commented Aug 14, 2018

Oh, and I'm sorry. I pinged the wrong user as well, just checked the username from the last comment :)

@Yannik
Copy link
Contributor Author

Yannik commented Aug 14, 2018

@joohoi Okay. The reason why this works is, that the client does recursively resolve the CNAME that is returned by acme-dns.

@Queuecumber
Copy link

@Yannik Yup you're correct, using ping the name is fully resolved, I incorrectly assumed dig would do the same. Thanks for the advice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants