DNS problem: NXDOMAIN looking up A for www.example.com - check that a DNS record exists for this domain - lets-encrypt

I'm trying to get an SSL certificate using the certbot from letsencrypt, but it keeps saying it's failing at the verification stage, with this error 'DNS problem: NXDOMAIN looking up A for www.example.com - check that a DNS record exists for this domain'
I currently have one host record, which is an A record, host '#' and value is set to my public ip address. Am I supposed to have more host records on my namecheap account?

You need to add a dns record similar to this:
www 3600 in CNAME #
or you can just copy the A record:
www 3600 in A 46.101.145.73
The first option is more resilient (it will carry all dns records from # to www, and this can have unintended consequences), the second is more performant.

Related

Heroku ACM fails, "CDN not returning HTTP challenge", even after I configured my DNS target

I bought a domain name at domain.com, and tried to link it to my heroku app. Heroku provided me a DNS target, and I have put it through to my "DNS record" config in domain.com.
However when I try to generate automatic SSL certificate for my app, it still fails and returns me "CDN not returning HTTP challenge". I referred to this documentation, it says the reason for this error is that I haven't pointed the DNS to the one provided by Heroku DNS target. But I have already done it
Is there anything I misunderstood, or do I basically have to wait for a few days for it?
Under name just list it as www.your_site.com, heroku says that it will forward www.example.com to example.com.
In this case, as long as you have www.example.com set up, example.com
isn't needed as users can reach your site via www.example.com and to
set up www.example.com you need to use CNAME Records which all DNS
Providers allow you to set.

DNS redirection from root domain to www for a heroku app

I can't configure my DNS in order to redirect my root domain to www.domain for a Heroku app.
I'm using Vultr's DNS. The problem is Heroku does not provide IP address so I can't add an A record, nor a CNAM record to redirect root to www (source):
DNS A-records require that an IP address be hard-coded into your
application’s DNS configuration. This prevents your infrastructure
provider from assigning your app a new IP address on your behalf when
adverse conditions arise and can have a serious impact to your app’s
uptime.
A CNAME record does not require hard-coded IP addresses and allows
Heroku to manage the set of IPs associated with your domain. However,
CNAME records are not available at the zone apex and can’t be used to
configure root domains.
Here is my DNS configuration:
Thus, the SSL certificate fails in Heroku:
My question is: how can I easily redirect the root domain of my Heroku app to www.domain.com?
Thanks.
ping with the DNS target you have got from Heroku. you will get the IP for that. Use that as Dns targe in vultr. worked for me.
example:
➜ ~ ping botletter.com.herokudns.com
PING botletter.com.herokudns.com (3.212.117.40): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Here use 3.212.117.40 IP in vultr DNS target

How do I change my whm/cpanel to use a FQDN and SSL?

I have purchased a server through GoDaddy and when I access WHM or the CPanel, it uses the IP address of the server rather than the host name. How to I change this to use the host name and put SSL on that host name?
You could access WHM both on IP and hostname. Please check if your server actually has a valid hostname. If not, then you can't use WHM via hostname, so you'll have to configure a domain on that server and create a hostname for your WHM server.
Upon provision I was given a hostname of the form:
s192.168.2.###.secureserver.net This will not resolve in a browser. Nor will a ping -a to an IP address. It is a temporary hostname. It will work for creating resellers and putting up websites but you will not be able to secure it with an SSL cert as far as I know. You need a hostname that is also a domain that resolves to your server's primary IP address to allow login to WHM.
And the server has a requirement for hostnames as being an FQDN. The requirements for an FQDN are:
- Do not select a hostname that begins with www or a number, or a hostname that ends with a hyphen (-).
- You must use a fully-qualified domain name (FQDN) that contains two periods (for example, hostname.example.com).
- Do not choose a hostname that a cPanel account on your server will use.
- Do not choose a potential proxy subdomain as a hostname (for example, cpanel.example.com or whm.example.com).
- Do not select a socially-unacceptable hostname. The hostname will appear in mail headers.
- Only use lowercase, Latin-script letters in hostnames.
On the part that requires that you install an SSL for connecting to a URL and port number I cannot address yet but I purchased a cheam domain name from Godaddy, it was then auto parked.
Went into the DNS records for the domain and pointed the A record to the primary IP address of the server.
Record: A # 192.168.2.#### TTL: 18000
You will want to delete all the other records listed there as an FQDN cannot have any subdomain or potential proxy. So no CNAMEs allowed.
Leave Godaddy's name servers NS as they are.
Give the domain settings time to propagate. (i.e. 15min - 24hours)
Connect back to your WHM via ip (https://192.168.2.###:2087)
Navigate to Basic Setup or enter Basic Setup into the search and click on the link.
Change the NS servers at the bottom of the page to GoDaddy's name servers.
Save Settings change.
Enter the new hostname in the Set Up Networking section of WHM's Initial Setup Assistant interface.
Save your settings.
Navigate to your new domain name preceded by "https://" and followed by ":2087" (i.e https://mynewhostname.com:2087 ).
I believe this will get you at least that far for your process.

Heroku SSL with Route53

My SSL certificate is all set up and ready to go on Heroku. I followed the instructions here https://devcenter.heroku.com/articles/route-53 to correctly redirect requests (e.g. example.com to www.example.com) using AWS S3. HTTPS works great when requestiong https://www.example.com; however, if I attempt to request https://example.com, the page cannot be found. Any thoughts?
Using Route 53, you want to create the following DNS records:
www.example.com CNAME your_app.herokuapp.com
example.com ALIAS your_app.herokuapp.com
Your www.example.com hostname should be a CNAME record that delegates to your Heroku App hostname. Any other regular hostnames should be CNAMEs.
The example.com "Apex" or "naked domain" record must return an A record and cannot be a CNAME. Route53 implements the ALIAS record type, which looks up the values for your_app.herokuapp.com and returns a set of current A records to match.
I've just been through this myself. The easiest and cheapest way to do it is to let Heroku (minimum 7 USD box) manage the SSL (ACM).
Add a custom domain there and enable SSL and you will be presented with a DNS target like: www.yourcustomdomain.com.herokudns.com. In Route53 add a CNAME record for your www.yourcustomdomain.com with the target into www.yourcustomdomain.com.herokudns.com.
Wait to refresh the DNS internationally.
I would assume the S3 bucket for directing the naked domain into the www.domain was done previous to the above mentioned.

Custom root domain on Heroku

I have a domain, example.com, that I want to use for my rails-app that resides at example.herokuapp.com and I'm pretty confused how to go about to do this.
Heroku says
"Zone apex domains (aka "naked", "bare" or "root" domains), e.g.,
example.com, using conventional DNS A-records are not supported on
Heroku." And then they go on explaining workarounds (using ALIAS or
ANAME).
I have spent a good hour reading up on the subject (here on SO and elsewhere) but still don't get my head around this.
Are there any alternative ways or explanations on how to acomplish this for "a dummy"?
I'll take a stab at this as it's a frequent question.
Ok, so assuming you have a domain example.com and you want to use www.example.com to host your site. In traditional hosting you'd probably have a virtual server which has been assigned an IP address, in this case you would use a host record, otherwise known as an A record in DNS control panels to map www.example.com to the IP address. In this case, since you have now set www.example.com to a fixed IP address should that IP address ever change you will need to update your DNS yourself.
Also, with traditional hosting you could have example.com set to the same IP address so www.example.com and example.com would work for naked domains.
Ok, so what's a CNAME record. A CNAME record rather than mapping to an IP address maps the record to another DNS entry. So, www.example CNAME'd to example.herokuapp.com means that Heroku can and may move where example.herokuapp.com is pointing at but you don't have to update anything as you're using an CNAME record and Heroku are managing where example.herokuapp.com is pointing (which can and may be another CNAME or an IP address). The problem with CNAME records is that they CANNOT point to an IP address, which is fine for www.example.com but a problem with example.com. Heroku previously published IP addresses to be used for naked domains but problems ensued when they suffered DDOS attacks and couldn't replace those IPs with new ones as they were published IP addresses. For the new EU region, Heroku ARE NOT publishing IP addresses for use with naked domains.
What several DNS providers (DNSsimple I know is one) have done is add their own ALIAS records to their DNS servers to allow you to use CNAME's with naked domains so both www.example.com and example.com will work as now supported by Heroku. If you DNS provider does not support ALIAS records then it's worth moving the domain to a DNS provider that does support it. DNSsimple also supports redirect records so you can have www.example.com redirect to example.com at the DNS provider level and not at your application layer.
Found this:
http://blog.cloudflare.com/zone-apex-naked-domain-root-domain-cname-supp
CloudFlare provides a whole bunch of other benefits as well. I've been using them for all of my Heroku apps and I'm quite pleased to be honest.
They provide a lot value for free from my experience with them thus far.
If you look at DNS records specification you'll find no such record as ANAME.
The best way to solve this problem is:
Make CNAME entry for www subdomain to your heroku app, and CNAME record for root domain to www subdomain.
www.domain.com. 3600 IN CNAME app.herokuapp.com.
# 3600 IN CNAME www.domain.com.
P.S. It works, and do not make you waste money for mystic DNS records

Resources