Amazon web service Route 53 ignore domain name - amazon-web-services

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.

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.

AWS Route53: Wildcard in secondary record set (*-Secondary) not working on failover

I configured a primary and secondary record sets in AWS Route53.
I am using an ALB (Application Load Balancer) for my primary, and a Web hosted S3 static page for my secondary. So both Record Set type is set as CNAME.
The name of the Record Sets:
Primary: route53.samplesite.net
Secondary: route53.samplesite.net
I was able to redirect my page to the secondary whenever the primary is down.
However I have one problem. My primary is consisted of several applications that works independently. When I say independently, I meant that I do the maintenance to each application separately so they are down at different times.
So, there's domain1, domain2, domain3 and so on set as my primary.
I wanted to set only one Secondary page for all my primary records and was hoping that it could work once I changed the domain name of the secondary to:
*.samplesite.net
and leave the primary to route53.samplesite.net,route53-2.samplesite.net, etc...
This is the only approached I tried but it is not working.
I know that it will work if I set a different secondary for each primary but is there any easier and a better way to accomplish my goal above?
No, there isn't.
On the right hand side, the * is not interpreted the same way it is on the left. It gets no special treatment as a target.
There is no way in Route 53 to map *.example.com to reference e.g. *.example.org so that for any value, the answer contains the same prefix with a different suffix. You'll need to configure them individually.

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

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

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)
}

Defining URL in CreateEnvironmentRequest of AWS Beanstalk Java API

When I create a new environment in AWS Beanstalk using its Java API, I pass the application name and the new environment name in a CreateEnvironmentRequest to the createEnvironment method.
After the environment is created the URL is something like my-environment-name-wixmmatir2.elastsicbeanstalk.com. But I don't know where the "wixmmatir2" comes from. It seems to be a string with random characters that Beanstalk adds to my URL.
Does anyone know why this happens?
Is there a way to force Beanstalk to respect the name I gave?
I need a predictable URL, such as my-environment-name.elastsicbeanstalk.com, without random characters being added to it.
To create environment with a specific URL you should set CNAME prefix on CreateEnvironmentRequest:
public void setCNAMEPrefix(String cNAMEPrefix)
JavaDoc for the method:
If specified, the environment attempts to use this value as the prefix for the CNAME. If not specified, the CNAME is generated automatically by appending a random alphanumeric string to the environment name.
Another helpful method to check if the specified CNAME is available:
CheckDNSAvailabilityResult checkDNSAvailability(CheckDNSAvailabilityRequest checkDNSAvailabilityRequest)
throws AmazonServiceException, AmazonClientException