1

I had previously hosted my domain in a different instance in a different aws account but for some reason I had to delete that aws account and create a new one. I am now trying to host my domain in the new instance. So I went to my registrar`s account and deleted all the nameservers from the domain name and added the new nameserver. Then I added my domain into the hosted zone in aws. enter image description here

After waiting for 2 3 hrs my domain is still now working but if I visit the public IP it works.

I have edited the /etc/hosts file and added domainname.com there and also I have edited the /sites-available/default and added

    server {
#        passenger_ruby /usr/bin/passenger_free_ruby;
        rails_env development; # add this if you get error like “Incomplete response received from application” from nginx / passenger
        listen 80 default_server;
        server_name fuitter.com, *.fuitter.com;
        root /usr/share/nginx/html/maggie/public/;

        # You must explicitly set 'passenger_enabled on', otherwise
        # Passenger won't serve this app.
        passenger_enabled on;
    }

I have restarted my nginx server but still it is not working. security group then, in inbound rule I have set HTTP to anywhere and SSh to custom ip and in outbound i have set all traffic to anywhere. Is there anything wrong with this?

Raaz
  • 113

1 Answers1

3

DNS does not have a single time to propagate. You will hear 24-48 hours often quoted, which is a common setting, but you need to know the specifics of your DNS records before you make changes.

Each record in DNS has a TTL value, which lets parties know how long they can consider a resolution to be valid for.

fruitter.com.           21600   IN      A       62.149.128.160

For fruitter.com, the A records have a TTL of 21600 seconds. This is 15 days. So anything that does a DNS query - including other DNS servers and hosts for fruitter.com do not need to, and should not, query the name servers for fruitter.com again until the 15 days has elapsed.

You can force a refresh on your host, by flushing DNS. You can clear the cache of your DNS server. These will get you a fresh up to date copy of the records. But this only affects what you control. Everyone else on the internet will be using the 15 day TTL.

So, if you are planning a change to anything that relies on DNS, your first step should be to understand the TTLs currently in place, and reduce them. Changing the TTL to 60 means that in 15 days time, you can make changes to DNS that will propagate inside a minute.

Of course, during this time, your DNS servers will see increased traffic, as the responses that are given are only valid for a minute, after which a new query to your servers must take place. So you need to plan for that too.

Finding a middle ground is the common approach. Reduce the TTL to the largest tolerable window depending on traffic and lookups. Make the change, then once the TTL has expired, change the TTL to something larger.

Some DNS providers, such as the one you are using, will set the TTLs very high by default to reduce the stress on their servers.

In some cases, DNS is used for high availability across sites, and so the TTLs are set as short as 15 seconds so that they can be quickly redirected to new IP addresses in response to outages. In these instances, large amounts of DNS queries are expected.

Paul
  • 61,193