Before pointing a domain to a new hosting account – hosts file trick + TTL

If there’s a new hosting account but the domain is not pointing to it, or you need the domain to continue pointing to the old account until the new account is ready, there is a way to emulate a dns change by manipulating the local hosts file – located at “C:\Windows\System32\drivers\etc” – just add a line with the new hosting account ip and the domain name – e.g.

82.80.201.26 domain2.com
82.80.201.26 www.domain2.com

This will work only locally for viewing the site with its future domain.

BTW

Before changing DNS settings it’s advised to change the TTL for the domain one day in advance to 5 / 10 minutes, so when the DNS change it will take much less time for the change to take effect.

Leave a Reply

Your email address will not be published. Required fields are marked *