Certbot - DNS problem: NXDOMAIN looking up A for xxx - check that a DNS records exists for this [closed]
Asked Answered
B

4

20

So I tried to run the following

sudo certbot certonly --nginx --dry-run -d subdomain.domain.com -d www.subdomain.domain.com

That gave me a DNS problem, however, it worked when running

sudo certbot certonly --nginx --dry-run -d subdomain.domain.com

Am I missing something in my DNS records?

I have sucessfully run

sudo certbot certonly --nginx --dry-run -d domain.com -d www.domain.com

Do I need to make a specific DNS record for the ´´www´´ part if I use subdomains?

Edit Result of running ´´dig subdomain.domain.com´´

; <<>> DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu <<>> subdomain.domain.co.uk
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45932
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;subdomain.domain.co.uk.           IN      A

;; ANSWER SECTION:
subdomain.domain.co.uk.    1800    IN      A       xxx.yyy.aa.dd

;; Query time: 88 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Fri Feb 07 11:24:26 UTC 2020
;; MSG SIZE  rcvd: 64
Bratwurst answered 7/2, 2020 at 11:12 Comment(4)
"Do I need to make a specific DNS record for the ´´www´´ part if I use subdomains?" Yes! You'll need a CNAME record for the www domain. Please show results of a dig subdomain.domain.com command!Leralerch
i posted that right nowBratwurst
No problem! It worked? I guess you should ad a CNAME DNS; www.subdomain CNAME @Leralerch
i had same issue with nginx and certbot. i added CNAME record in AWS Route53 for subdomain www and pointed it to domain. Ex: if domain is abc.com then create CNAME record with name www and value as abc.com. post that certbot generated certificate.Pooi
S
29

Adding proper answer from the question:

Create an type A entry with the host "www.subdomain" and you're good

I'd add to wait anywhere between 5 minutes to an hour for the record to take effect and for certbot to be able to see it, from my experience.

Suitor answered 2/6, 2020 at 6:58 Comment(2)
Where applicable, instead of an A DNS record, a CNAME DNS record can also resolve the issue.Rizika
or simply remove www from your command in last: sudo certbot certonly --nginx --dry-run -d subdomain.domain.com -d subdomain.domain.comConcise
R
12

In my case I didn't add www to my domain add A record pointing to server

www.mydomain.com

Al together you need only two A records in domain pointing to your server ip with and without www

mydomain.com

Hope this helps !!!

enter image description here

Ramp answered 15/6, 2020 at 8:21 Comment(0)
A
10

If you are using subdomain than for the subdomain you don't need www.

The modified command is as follows: sudo certbot certonly --nginx --dry-run -d subdomain.com -d www.subdomain.com

Arbitration answered 21/4, 2020 at 13:25 Comment(3)
did you mean to write "www.subdomain.com" in one of those?Bratwurst
yes instead of writing www.subdomain.com go with subdomain.comArbitration
Why would you want to add the same domain twice?Loy
I
-1

I forget to add www A record in my godaddy DNS settings You May try this one hope for best...

Insatiable answered 18/7, 2022 at 16:18 Comment(1)
The other answers already say to add the "www" A record. Why is another answer needed?Loy

© 2022 - 2024 — McMap. All rights reserved.