Numeric IP address reachable, but domain name not reachable
I have a domain registered through Route53, and I'm unable use the named address to reach my server.
If I connect using the public numeric IP address of my instance, I get the Apache default page.
If I connect using the domain name (or subdomain) I get "Can't connect to server".
Here's what I have done:
In Route53, my registered domain shows up under Registered Domains In Route53, when I click on Hosted Zones it shows two entries:
mydomain.org ... HostedZone mydomain.org ... main site
I don't recall having created the first one, so I'm not sure why I have two. They are different from each other in the following way: The HostedZone one contains an NS, SOA and two CNAME records. The mainsite entry contains an NS, SOA, and two A records, one for each subdomain and each pointing to the public IP numeric address of my instance.
What am I doing wrong?
I understand that you are not able to reach the Default apache page with domain name, When you register for the domain in registered doamins, AWS will automatically create a Hosted Zone for you , It is simply a Control panel or DNS manager.
So, Now you have a HostedZone Configured let's say
mydomain.org and You need to configure like the below. NS and SOA are created by AWS for you.
|Record Name||Record Type||Routing Policy||Value|
|mydomain.org||A||Simple||IP Adress of Server|
|test.mydomain.org||A||Simple||IP Adress of Server|
Okay, If the above DNS entries are good, Let's look at apache Configuration.
When you install apache, it will have the default configuration file in this location
/etc/apache2/sites-available/000-default.conf , Please check
ServerName mydomain.org and
ServerAlias test.mydomain.org are present in the server
# Begin vhost record on the default HTTP port 80 <VirtualHost *:80> # This is the name of the vhost. ServerName mydomain.org # These are alternative names for this same vhost. # We put the other domains here. They will all go to the same place. ServerAlias test.mydomain.org # Directory where the website code lives. DocumentRoot /var/www/html <Directory /> Options FollowSymLinks AllowOverride All </Directory> </VirtualHost>
If about requirements are met you do not have any issues, If you have any issues please let me know
Thanks very much for your answer! It was very helpful. What I was missing was an A record for the domain; I only had A records for the subdomains. I'm using a separate .conf file from the default in Apache, but that file had the correct info. Unfortunately it has stopped working without my having done anything. I'm still confused about why I have two hosted zones. Should I delete the other one that has the CNAME entries?
I dot not underatand the "CNAME" records, as far as i understand you have "A" records, So better check the apache is running or not, You can use the command "service apache2 status" to see apache is running, always you check the DNS information by enter the DNS using google https://toolbox.googleapps.com/apps/dig/
AWS Route 53 DNS errors after moving from LightSail to EC2asked a year ago
DNS address could not be found. Diagnosing the problem. DNS_PROBE_POSSIBLE | Non-Existent Domainasked 5 months ago
How do you route a root domain to an application balancer via a static IP address?asked 3 months ago
Route53 Subdomain IP Mapping Issueasked 3 months ago
Numeric IP address reachable, but domain name not reachableasked 2 months ago
ELB Rule if Host Header is not equal toasked 2 months ago
How can I use the same domain name in different AWS accounts?asked 3 years ago
Very basic DNS setup, not workingasked 2 years ago
Using own domain for cognito. Rejected bc no A record. But I have one.asked 3 years ago
Route 53 to EC2 connection not workingAccepted Answerasked 2 years ago