RRSet with DNS name _acme-challenge.mybar.org. is not permitted in zone bar.org. while letsencrypt certificate generation - amazon-web-services

I have two domain names in aws route53:
bar.org
mybar.org
i am trying to generate Letsencrypt certificate using ruby based hook of dns-01 challenge ( https://gist.github.com/joshgarnett/02920846fea35f738d3370fd991bb0e0)
I am generating certificate for the domain "mybar.org", so my domains.txt contains the name as:
mybar.org
when i try to run dehydrated -c i get the following error:
RRSet with DNS name _acme-challenge.mybar.org. is not permitted in zone bar.org.
why does it try to add RRSet in bar.org instead of mybar.org? How do i get it working?

ruby based dns hook linked in the question has a bug at the following line at find_hosted_zone function while finding the hosted zone index out of available Route53 zones.
index = hosted_zones.index { |zone| domain.end_with?(zone.name.chop)
}
index is derived based on the zone ends with the give domain name. Since my domain name "mybar.org" evaluates to true with "bar.org" (other available zone), it returns index of that zone. So this needs a PR to solve the issue.
in my case it worked fine while i modified the code as:
index = hosted_zones.index { |zone| zone.name.chop.end_with?(domain)
}

Related

Can't get a domain verified on AWS after transfer

After transferring a domain from another registrar to AWS, I can't get it verified in the Certificate Manager. I created a hosted zone, the CNAME records created by the Certificate Manager are there, I tried with the DNS tester - the records seem good. However it still says "pending validation". I tried a few times, waited a couple of days and it doesn't seem it will work.
I'm totally out of ideas, any help?
DNS validation require 2 things to be setup correctly. Record Name and Record Value
Check if you're correctly setting these in Route53. Reference Doc here: https://docs.aws.amazon.com/acm/latest/userguide/dns-validation.html
Now 2 issues which are very common
In the Record Name part confirm that you're not adding your domain name in the value. _X is the only part you have to copy-paste. If you copy _X.YourDomain then 'YourDomain' part is duplicated
Record Value ends with . (a period / dot). Don't remove that period
You can verify the settings from https://mxtoolbox.com/ it has various configurations like A record, CNAME, DNS Validation, etc.

How to update NS of a DNS in GCP

What is the business impact you are facing?
Hi , We have domains say mildev.com and it has it original 4 NS assigned while creation. I want to append a few more name servers to it (my secondary NS).
but when i try to update the NS list using terraform it fails with
Error: Error creating ResourceDnsRecordSet: googleapi: Error 409: The resource 'entity.rrset' named 'mildev.com. (NS)' already exists, alreadyExists
Of-course, the name mildev.com NS [[NS_list_origina_]] is there but is there a way i can update? I see update is allowed using UI but why isnt it allowed via APIs?
Any guidance will be helpfull.
Thanks
type = string
default = "mildev.com."
}
resource "google_dns_managed_zone" "selected" {
name = format("d-%s",replace(trim(var.domain_name , "."),".","-"))
dns_name = var.domain_name
visibility = "public"
}
locals {
sec_name_servers = [
"pdns93.net.",
"pdns94.biz.",
"pdns93.com.",
"pdns93.org.",
]
}
resource "google_dns_record_set" "add_ns_records" {
name = google_dns_managed_zone.selected.dns_name
rrdatas = concat(local.sec_name_servers,google_dns_managed_zone.selected.name_servers)
ttl = 86400
type = "NS"
managed_zone = google_dns_managed_zone.selected.name
}
When Terraform creates a google_dns_managed_zone, the zone automatically gets created with NS records specific to Google Cloud (nameservers they provide that the zone will live on). Terraform does not import these NS records into state, so all future attempts to add or manipulate NS records in any Google Cloud Zone will fail, citing that the record set already exists: 1 2
google_dns_record_set.clouddns_ns: Error creating DNS RecordSet: googleapi: Error 409: The resource 'entity.change.additions[0]' named 'domain.com. (NS)' already exists, alreadyExists.
Additionally make sure you are using the latest terraform version.
$ terraform -v
You will not change the name servers there, as the NS records (usually) are being configured at the domain registrar - not in Cloud DNS. Unless the registrar would be Google Domains, your code might be running against the wrong site. When updating NS in Cloud DNS (in case this may even be possible), but not the registrar, you might end up with broken DNS resolution.
Adding / removing NS is generally a strange concept, as one may add this type of record once and then forgets about it... besides, Cloud DNS has 100% guaranteed uptime and it distributes quickly.
The default NS to use would be eg:
ns-cloud-c1.googledomains.com.
ns-cloud-c2.googledomains.com.
ns-cloud-c3.googledomains.com.
ns-cloud-c4.googledomains.com.

CNAME entry not working on NameCheap using Amazon Certificate Manager [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
I am trying to set up a few SSL certificates in Amazon Certificate Manager, but I am trouble getting them verified after adding the CNAME in Namecheap.
Here is an example of the CNAME verification entries at Amazon Certificate Manager
Here is an example of another domains CNAME entry at Namecheap
If I put the entire value of the Name entry into Host at Namecheap, the verification fails. I also get an error on some long domains I have, as the Name entry exceeds 60 characters.
Can anyone assist with the correct parts needed to verify via DNS using Namecheap?
In the CNAME record enter - _cff0cda88701846cbe7a34cd737378e2 as the host field and - _490287b8f448e2cca3862ebb4a51591.acm-validations.aws in the value field.
Once done wait for at least 1 hour for the changes to reflect.
If anyone is looking for NameCheap DNS record validation for AWS CloudFront ssl validation then please refer screenshot below. This NameCheap DNS record validation worked for me as of Jul 2019
Adding a more complete answer.
Some DNS provider like Namecheap appends the bare domain name to the DNS record. In effect, if you add the full record provided from Amazon Certificate Manager like so (replace example.com with your domain):
_cff0cda88701846cbe7a34cd737378e2.example.com
What you'll end up with is
_cff0cda88701846cbe7a34cd737378e2.example.com.example.com
To check if this is the case, after you have added the DNS record, run this command (on Unix)
dig +short _cff0cda88701846cbe7a34cd737378e2.example.com.example.com
If it returns the CNAME record, you have to omit the domain name from your DNS record so you won't get a duplicate domain name in there. Then run
dig +short _cff0cda88701846cbe7a34cd737378e2.example.com
You should get the corresponding CNAME record from it. The validation can take up to 48 hours.
Even though AWS includes it, do not include the domain name itself in the CNAME Host field for Namecheap (they apparently append it for you); just chop that off at the end. The value field is fine.
Give it half an hour.
namecheap.com does now allow a leading underscore in the Value field.
As specified in the AWS docs' Troubleshoot DNS Validation Problems ,
you can remove the underscore from the ACM-provided value and validate your domain without it.
In your case, the Value would be:
490287b8f448e2cca3862ebb4a51591.acm-validations.aws.
Where the trailing dot should still be permitted.
For any one using a subdomain like - api.example.com.
In the CNAME record enter - _cff0cdhash.api as the host field and - _490287b8f4hash.acm-validations.aws in the value field. As namecheap itself appends example.com to it. I was not able to figure out a way to make it work for www.api.example.com.
above worked for me except for the root domain validation ; there I had to add entire string _cff0cda88701846cbe7a34cd737378e2.example.com
instead of _cff0cda88701846cbe7a34cd737378e2. for the certificate to be issued.
For the others, _cff0cda88701846cbe7a34cd737378e2.www was enough. Hope it helps. Just did this today.

Amazon web service Route 53 ignore domain name

I have a group of micro-services hosted on AWS, these services interact with each other through request/response using DNS name defined on Route 53 at which i created a new private zone named api.io and defined the DNSs for example WSG_KAFKA, in my code i have configure the DNS name with the zone name like WSG_KAFKA.api.io
Is there is any way to ignore the domain name api.io and use the DNS name directly
To use the hostname directly you need to edit your /etc/resolv.conf and add search api.io option, so your file may look like:
search api.io
nameserver 10.0.0.2
That will help to just search your hostname by just using WSG_KAFKA.
From the man resolv.conf:
search Search list for host-name lookup.
The search list is normally determined from the local domain
name; by default, it contains only the local domain name.
This may be changed by listing the desired domain search path
following the search keyword with spaces or tabs separating
the names. Resolver queries having fewer than ndots dots
(default is 1) in them will be attempted using each component
of the search path in turn until a match is found. For
environments with multiple subdomains please read options
ndots:n below to avoid man-in-the-middle attacks and
unnecessary traffic for the root-dns-servers. Note that this
process may be slow and will generate a lot of network traffic
if the servers for the listed domains are not local, and that
queries will time out if no server is available for one of the
domains.
The search list is currently limited to six domains with a
total of 256 characters.

Importing zone file from godaddy to AWS encountered this error

I am trying to upload zone file from godaddy to AWS, when I copy paste the zone file content to AWS and click upload, the following error appeared:
Error parsing zone file: Error in line 38: Invalid address: >>++PARKED1++<< (encountered after 1 correct records)
In line:
# 600 IN A >>++PARKED1++<<
It looks like your domain was 'parked' with GoDaddy at the time you tried to export you zone file. >>++PARKED1++<< is an internal variable which GoDaddy use in there DNS Db.
The actual record is an A record and you should just replace >>++PARKED1++<< with the external IP address of your hosting provider. (e.g 1.1.1.1)
After the change you should expect that line of the config file to read as;
# 600 IN A 1.1.1.1 (For example.)
The GoDaddy help page also says;
The exported data follows the BIND zone file format and RFC 1035. You
must manually edit the exported data before a BIND DNS server can use
it directly. These edits will differ based on the requirements of the
server to which you are uploading the exported file.
But sadly it does not provide any useful pointers to the reader as to what exactly needs to be changed...
If you are mapping to an elasticbeanstalk.com endpoint then you shouldn't use an IP address (as they may change) and instead change the record type to ALIAS and then add the name of your endpoint xxxx.elasticbeanstalk.com
I was stuck exactly here for a while, and I think I might have an answer.
In place of the -parked- / missing 'a record' value, use the IP of the current application with a temporary adress.
For example, the IP address of example.eu-north-1.elasticbeanstalk.com
If unknown this IP address can also be found at www.whatsmydns.net.
Just type in the temporary address (e.g. the EB url address above) and the IP will show.
I.e. this is the -A Record- to use in place of the word -Parked-... copy & paste.
A second update on this..
After a couple of days I learnt that method above did not work too well.
Essentially, the A - IPv4 address of my EB app kept changing every so often.
Instead I updated the A Record to ALIAS (by ticking Alias = Yes) then entered the address of my EB app. Example xxxxxx.elasticbeanstalk.com
So far this has worked..
Just remove that line and use import. After the import, you can add the alias to the IP address