unable to resolve host on ec2 instance

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


unable to resolve host on ec2 instance



I SSH'ed into the server to do some updates, along the way I lost HTTP connectivity to the web site.



When I was updating, after encountering problems with yum, one of the things I read and tried, without really understanding was:


sudo dhclient



It's just about about the only thing that seemed to network related.



When I try the following from my PC:


curl -v http://sub.my-web-site.com/



the result:


* Hostname was NOT found in DNS cache
* Could not resolve host: sub.my-web-site.com
* Closing connection 0
curl: (6) Could not resolve host: sub.my-web-site.com



When I try connect via the IP address, one of the virtual hosts seems to respond.



I have rebooted the instance a couple of times to no avail. I don't seem to recall changing any settings on the instance and it doesn't seem to be a part of a VPC.



The DNS is in route 53, and after rebooting, the public IP of the instance changed, so I updated in route 53 accordingly.
enter image description here



I tried dig from a couple of other servers, with slightly different results:


dig sub.my-web-site.com

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 56905
;; QUESTION SECTION:
;sub.my-web-site.com. IN A
;; AUTHORITY SECTION:
my-web-site.com. 300 IN SOA 01.dnsv.jp. hostmaster.dnsv.jp. 1531475254 3600 900 604800 300
;; SERVER: 202.167.237.16#53(202.167.237.16)

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 56905
;; QUESTION SECTION:
;sub.my-web-site.com. IN A
;; AUTHORITY SECTION:
my-web-site.com. 60 IN SOA 01.dnsv.jp. hostmaster.dnsv.jp. 1531475254 3600 900 604800 300
;; SERVER: 10.0.0.2#53(10.0.0.2)



How can I get this resolved?





Can you give more details: you have an EC2 instance that is NOT the web server you want to connect to? Or those 2 servers are the same?
– Alexandre Fenyo
1 hour ago




1 Answer
1



DNS resolution is unrelated to the server itself. The fact that you are receiving different responses from different servers suggests that there is a propagation delay.



Try again after a couple of hours and see whether all servers resolve the same way.



One method to avoid this delay is to assign an Elastic IP Address to the EC2 instance. This address will not change when an instance is stopped/started and it can also be instantly assigned to a different instance (with no propagation delay). You would point an A record from the DNS name to the Elastic IP address and then there would be no need to change it in future.


A






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

Visual Studio Code: How to configure includePath for better IntelliSense results