ex: ec2-203-0-113-25.compute-1.amazonaws.com
ex: url marked in this pic https://i.stack.imgur.com/xKcP1.png
How does the routing takes place in AWS services ?
According to url they seem to use routing according to subdomain but registering a subdomain needs 24 hours to propagate through dns servers , so how aws is handling this ?
A user just asks for a ec2 instance and aws gives those public url (not talking about public ip) instantly, they may be routing all * subdomain queries to a particular server and routes requests from there, am I correct ?
Even is the case is like above how to route further into network ? any software of hardware need to be studied here ?
And aws may be having several levels of subnets for internal network , any tool to manage or need to be studied here ?
How ec2-203-0-113-25.compute-1.amazonaws.com is helping to reach exact server ip ?
DNS change need time because of the premise that layers between you and the DNS caches the DNS response, that can be as long as 24hr or more even. So, when you update the domain name to another IP, It is possible that you need to wait for hours
However, you see at the domain ec2-203-0-113-25.compute-1.amazonaws.com , the part 203-0-113-25 is actually it's public IP address and it does not change. As soon as you change your public IP address, your public DNS is switched to the same pattern also.
Therefore, there is no need to update any public DNS record that can be cached by all the layer inbetween
Related
I have a site running on ECS in AWS with the DNS being handled by Route53.
There are two network interfaces which I can use the Public IP addresses of to access the site. The problem is Google has indexed this IP addresses as well as the domain name.
How do I "redirect" the IP addresses to the domain name?
There are 2 aspects in your question:
You want your access using IP to resolve to your domain name
Google indexing your site with the wrong URL
For your 1st challenge, there isn't a native way to force browsers from IP back to URLs. You have to handle this in your application or infrastructure. Since you're running in ECS, that could either be a rule in a Load Balancer (e.g. if using Application Load Balancer, a rule that checks if Host-Header doesn't match your domain then redirect to your domain URL), or you could write the logic into your container.
Regarding the #2 problem, that might be because your IP was added to some site in the internet (remember that IPs are re-used in AWS), and as a result Google has the IP in the cache and it's refreshing it. To handle this problem, you might need to review if it's possible using Google's Removals Tool.
I am using a public API hosted behind CloudFront. I want to get the least possible latency.
I have done the following things so far:
Hosted my code on EC2 in the same region as the API origin server. (I have a clue as to which region the origin server could be hosted in based on ping times)
Tried pinging the API domain name from various availability zones within that region and identified the zone with least ping time.
However during my testing, I came across instances where ping time from my desktop was smaller than the ping time from my EC2 instance. So I had a look at what the CNAME & IP, the original API domain name was getting resolved to in each case. I found them to be different.
Is there something I can do to ensure that DNS resolution of CloudFront leads me to the lowest latency link.
I can use the CNAME or IP that I found to be the fastest during my testing. But that CNAME/IP may change so that's not a proper solution.
I think the answer could lie in a smart DNS client which pings all the servers in DNS file periodically and resolves DNS requests to the the fastest IP. However I don't know if any such client exists and how to use it if it does.
I would like to hear your ideas.
Is there something I can do to ensure that DNS resolution of CloudFront leads me to the lowest latency link.
If you have your own domain name, you could try using Route53's latency record or Geoproximity routing
So, I've created a website xxxxxxx.com (removing from post)
I registered it with Route 53.
Registered Domain - Established Hosted Zone
Established 2 Record Sets one of xxxxxxxx.com and one for www.xxxxxx.com
Record Set Details for one of the paths
But when I go to ping www.xxxxxxxx.com or xxxxxxxx.com - I don't get a response.
When I go to a DNS checker site - it fails all DNS servers.
I've been all over the place trying to get this to work, concerningly, it did work at one time, but then failed. I have deleted the hosted zone twice and rebuilt it. I have NOT touched the named servers.
S3:
setup 2 buckets, named appropriately. xxxxxxxx.com and www.xxxxxxxx.com
Both have two files on them. Block public is unchecked.
Static Web hosting is enabled.
Selected both files and set to Actions --> Make Public
Testing on their own with these addresses:
**edited - I had to remove the direct S3 Web hosting as once posted here they got hammered with hits.
I did try one other thing:
Route 53 --> Traffic Policies --> Create Traffic Policy -->
DNS Type a: IP address in IPv4 format to Endpoint Type S3 website endpoint Value xxxxxxxx.com.s3-website-us-east-2....
This does not appear to have rectified the situation, unfortunately. And they want to charge $10 a month to direct it with www. prefix - which doesn't make any kind of sense, so I didn't do that.
Any advice or help that can be rendered would be helpful! I've covered most of the ground with Amazon and videos setting up domain to S3 to no avail.
Something seems off with your DNS records: https://www.whatsmydns.net/#NS/fojsan.com
Domain registered 2 days ago, should have NS listed in all regions. Leave the S3 for the time being and focus here. If DNS record can not resolve , S3 will not work.
Make sure that DNS entry for NS (name Servers) is set to:
ns-1145.awsdns-15.org.
ns-1694.awsdns-19.co.uk.
ns-20.awsdns-02.com.
ns-576.awsdns-08.net.
It looks like it might have been removed and are expiring.
Even though I have a private domain configured in route 53 resolver for a vpc, new instances still have default names like:
ip-10-1-1-170.ap-southeast-2.compute.internal
Is there a way to configure things such that new instances will automatically have an FQDN of the (sub)domain I have configured like:
ip-10-1-1-170.green.example.com
I am hoping to ensure that instances in seperate deployments (dev/green/blue) have FQDN's in seperate sub domains (and different VPCs), so that I can configure my onsite DNS to know where any host is based on that sub domain in its name, but automatically getting the host name on start is the first step on that journey.
I can successfully create route 53 records to achieve this too one by one, but it seems a bit nuts for a compute cluster, so I'm hoping that theres a way to achieve it just with the host name and the route53 resolver will still correctly handle DNS requests to those hosts somehow.
This domains are actually related to the domain controller that the instances are bound to.
When you create a VPC, the default DHCP configuration is amazons DNS (AmazonProvidedDNS) which in your case is providing the ap-southeast-2.compute.internal domain names.
If you added a custom DHCP option set of green.example.com then this would become part of that domain and show the DNS as you expect, although you are limited to one DHCP option set per VPC.
AWS have the following services which can act as domain controllers although you would need to ensure that your on premise can also forward requests to these name servers to resolve the domains:
Simple AD
Managed Microsoft AD
This is quite a bit of overhead in order to get the DNS names like those domains, it might be simpler by using 2 private hosted zones and automatings adding hosts to the domains along with an inbound endpoint instead from your on premise.
I've setup a couple of EC2 instances in different regions and have configured A record sets in my hosted zone. All is working correctly, but I want to be able to check were a certain request is going. So if a request is done through webpagetest.org from Europe, is there a way I can check that Route 53 is routing it correctly to my EC2 instance in Ireland (assuming that it has the lowest latency)?
That site doesnt tell you what ip address is resolved in the request. You should try something like pingdom to see if the request is resolving to the correct ip address from different points around the world.