Blog
SavedSearch
Visit Hostlelo

Lower DNS TTL Before a Move and Check It With dig

Most old-server panics after a move come from a TTL nobody lowered. Read it with dig, lower it ahead of time, and flush Google's cache once you switch.

The short answer

A guide to lowering DNS TTLs before a server move so the switch takes minutes instead of hours. It shows how to read the TTL with dig at the authoritative nameserver and at Google Public DNS, how to time the change, and how to flush Google's cache. It covers cPanel Zone Editor, Windows checks and common problems such as CNAME chains and domains that cannot be flushed.

Reading options

On this page

If your site still points to the old server after a move, the usual cause is caching. Resolvers around the world saved your old DNS answer, and they are allowed to keep it until its TTL runs out. Lower that TTL a day or two before the move and the switch can happen in minutes instead of hours.

Nobody thinks about TTL until half the visitors still land on the old server. By then the wait is already promised.

By the end of this guide you will be able to read a record's TTL with dig, lower it ahead of a migration, check what Google Public DNS is serving, and ask Google to drop a stale answer.

What a TTL actually is

TTL stands for time to live. It is a number of seconds attached to every DNS record that tells other servers how long they may keep a copy before they must ask again.

RFC 1035, the original DNS specification, describes it as the time interval that a record "may be cached before the source of the information should again be consulted." A TTL of zero means the answer is good only for the lookup in progress and should not be cached at all.

Think of it like the date on a milk carton. The shop can keep selling that carton until the date, even if the dairy has started making a different recipe.

A resolver is the server that looks up names on behalf of your laptop or phone, such as the one your internet provider runs or a public one like Google Public DNS. When a resolver fetches your A record (the record that maps a name to an IPv4 address), it stores the answer and starts counting down from the TTL.

Made-up example: your A record for example.com points to 192.0.2.10 with a TTL of 86400, which is one day. A visitor's resolver looks it up at 09:00 on Monday. You move the site to 203.0.113.25 at 10:00. That resolver may keep sending people to 192.0.2.10 until about 09:00 on Tuesday, because that is when its copy expires.

Two more rules from the standards are worth knowing. RFC 2181 says a TTL is an unsigned number from 0 to 2147483647, and that "The TTL specifies a maximum time to live, not a mandatory time to live." It also says implementations are always free to put an upper bound on any TTL they receive, so a resolver may throw your answer away sooner than you asked, but it should not keep it longer.

RFC 2181 also says that all records in an RRSet must share the same TTL. An RRSet is simply every record with the same name and type, for example all the A records for www.example.com. So if you have two A records for one name, give them one TTL.

Before you start

Run through this list before you touch anything.

  • Access to the DNS host. This is wherever your nameservers point, which may be your registrar, your hosting panel or a separate DNS service. If you are not sure, the guide on how to map a host to your domain walks through where records live.
  • A laptop with dig installed. It is part of the BIND tools, so install your system's DNS utilities if the command is missing. On Windows you can use nslookup for basic checks.
  • The move date and time, written down, in your own time zone and in UTC.
  • A note of the current values: every record you plan to change, its current value and its current TTL. A screenshot of the zone works too.
  • Your risk level. A personal blog can live with a few hours of mixed traffic. An online shop or a mail server cannot, so plan more lead time and a rollback.

If email is moving too, write down your MX and TXT records as well. The SPF, DKIM and DMARC records in that set break quietly when copied wrong, and the small business email setup guide explains what each one does.

Lowering the TTL step by step

The idea is simple. You shorten the TTL while everything still points to the old server, wait for the old long TTL to expire everywhere, then make the real change.

Step 1: Read the current TTL with dig

dig is a command line tool that sends a DNS question and prints the reply. According to the BIND manual its basic form is dig @server name type, where @server is the resolver to ask, name is the host name and type is the record type, and all three are optional. The -t type option is another way to pick the record type. If you leave out @server, dig asks the resolvers listed in /etc/resolv.conf.

This command asks your default resolver for the A record of example.com and prints only the answer section.

dig +noall +answer example.com A

The +noall option turns off every display section and +answer turns the answer section back on, so you get a clean line per record. In that line the second column is the TTL in seconds. If you asked a caching resolver, this is the time left on its copy, so it shrinks each time you repeat the query.

To see the full TTL your DNS host has set, ask the authoritative nameserver directly. An authoritative nameserver is the one that holds the real zone rather than a cached copy. This command first lists your nameservers in short form.

dig +short example.com NS

You should see one nameserver hostname per line. Pick one and ask it directly with the next command, replacing the name with one from your list.

dig @ns1.example.com +noall +answer example.com A

The TTL in this reply is the configured value, and it will not count down between runs. Write it down next to the record. Repeat for www and any other names you plan to move.

Step 2: Check the zone's negative caching value

Resolvers also cache the answer "this name does not exist". RFC 2308 says that when the authoritative server builds such a negative answer, its TTL "is taken from the minimum of the SOA.MINIMUM field and SOA's TTL."

That matters if you plan to create a brand new name during the move, such as new.example.com, and someone looks it up before it exists. This command shows the SOA record, where the last number is the MINIMUM field.

dig +noall +answer example.com SOA

You should see one line. The second column is the SOA record's own TTL, and the final number on the line is the MINIMUM. The smaller of the two is how long a "does not exist" answer can stick around. The simple fix is to create new names before anyone has a reason to query them.

Step 3: Lower the TTL at your DNS host

Open the zone at your DNS host, find each record you will change and lower its TTL. Leave the value itself alone for now.

How low? Amazon's Route 53 guide gives sensible general advice: "If you're changing settings for a domain or subdomain that's already in use, specify a shorter value first, such as 300 seconds, and increase the value after you confirm that the new settings are correct."

Three hundred seconds is five minutes. That is short enough for a quick switch and long enough that you are not hammering your DNS host. Your DNS host may have its own minimum, so check its documentation.

Save the change and make sure the save went through before you close the tab.

Step 4: Confirm the new TTL at the source

Run the authoritative query from Step 1 again.

dig @ns1.example.com +noall +answer example.com A

The second column should now show 300, or whatever value you chose. If it still shows the old number, the save did not apply, or you edited a zone that is not the live one. Fix that before you go any further.

Step 5: Wait out the old TTL

This is the step people skip. Resolvers that cached the record before your change still hold the old long TTL. They will not see your new short TTL until their old copy expires.

So if the old TTL was one day, wait at least one day after Step 3 before you change the IP address.

Step 6: Make the real change

At your planned time, update the record's value to the new server, for example from 192.0.2.10 to 203.0.113.25, and keep the TTL short. Then check the authoritative server once more.

dig @ns1.example.com +short example.com A

The +short option prints a terse answer, so you should see just the new address, 203.0.113.25. If you also have an AAAA record (the IPv6 version of an A record), update it too, for example to 2001:db8::10, and check it with the same command using AAAA instead of A.

Step 7: Raise the TTL again

Once the new server has run cleanly for a while and you have checked it from several places, raise the TTL back to a longer value. That follows the second half of the Route 53 advice: increase the value after you confirm the new settings are correct.

The timing plan

Here is a plan you can copy into a calendar. The hour counts are my advice for a typical small site, built around the rule above, and assume the old TTL is no longer than a day. Scale them up if your old TTL is longer.

  1. Two days before the move: read and record every current TTL with dig (Step 1). Check the SOA values (Step 2).
  2. About 48 hours before the move: lower the TTL on every record you will change to something like 300 (Step 3) and confirm it at the source (Step 4).
  3. During the next day or so: wait. Make sure the gap is longer than the old TTL you recorded.
  4. A few hours before the move: query a public resolver such as 8.8.8.8 and check that the TTL it reports is now small.
  5. Move time: change the record values (Step 6), confirm at the source, then check public resolvers.
  6. Up to an hour after the move: keep the old server running and watch its logs for stray visitors. Flush Google's cache for any name that still shows the old address.
  7. One or two days after the move: if everything is fine, raise the TTL back up (Step 7).

Keep the old server alive until you raise the TTL at the end. An old server that still answers is a kinder failure than an error page.

Variants

cPanel Zone Editor

If your DNS lives in cPanel, the cPanel documentation describes the edit path as Zone Editor > Manage next to your domain, then Edit next to the record you want. Update the values in the text boxes, then click Save Record or Save All Records.

The Manage Zone table lists each record's Name, TTL, Type and Record, so you can read the current TTL there before you start. The cPanel docs do not list the allowed TTL values or a default, so check the TTL column and the TTL field your panel shows when you edit a record. Then confirm the result with dig against the authoritative nameserver, exactly as in Step 4.

Other DNS hosts

Every DNS host puts the TTL field somewhere different. Search your provider's documentation for "TTL" and the record type you are editing.

Whatever panel you use, dig against your authoritative nameserver is the ground truth. If the panel says one thing and dig says another, believe dig.

If your DNS sits with a proxy service such as Cloudflare, read that provider's own TTL notes before you plan the move.

How to check it worked

Compare Google Public DNS with your own resolver

Google Public DNS answers on 8.8.8.8 and 8.8.4.4 for IPv4, and on 2001:4860:4860::8888 and 2001:4860:4860::8844 for IPv6. This command asks Google directly.

dig @8.8.8.8 +noall +answer example.com A

You should see the new address in the last column and a small number in the second column. Now run the same query without @8.8.8.8, which asks whatever resolver your machine uses.

dig +noall +answer example.com A

If both show the new address, you are in good shape. If Google shows the new one and your own resolver shows the old one, your resolver still has a cached copy, and the TTL column tells you roughly how many seconds it has left.

The nslookup alternative on Windows

Microsoft's documentation describes a non-interactive mode where the first parameter is the name to look up and the second is the DNS server to ask. This command asks Google for example.com.

nslookup example.com 8.8.8.8

You should see the server you asked, followed by the address it returned. For reading TTLs, dig is the clearer tool.

If your own Windows machine keeps showing an old answer, Microsoft documents ipconfig /flushdns as the command that "Flushes and resets the contents of the DNS client resolver cache." Run it in a Command Prompt, then test again.

Flush Google's cache

Google runs a public Flush Cache tool at https://dns.google/cache. You do not need to prove you own the domain, but Google's FAQ says you must solve a reCAPTCHA, which is there to stop automated abuse.

  1. Open https://dns.google/cache in a browser.
  2. Enter the name you changed, such as example.com, in the Domain Name field.
  3. Enter the record type you changed, such as A, in the RR Type field.
  4. Solve the reCAPTCHA if the page asks for one, then click Flush Cache.
  5. Repeat for each other name and each other record type you changed, starting with the main domain and then subdomains such as www.

Google's cache page says that if the registrar or DNS hosting for a domain changed recently, you should flush the main domain name first before flushing subdomains. Its FAQ adds that flushing a record type for a domain also flushes the delegation information about that domain's name servers.

Whatever confirmation the page shows, the real test is a fresh query. Run dig @8.8.8.8 +noall +answer example.com A again and you should now see the new address.

If you would rather not flush, you can wait. At the time of writing (24 November 2026), Google's FAQ says its TTLs are generally limited to six hours even if the actual TTL is longer.

Troubleshooting

Some resolvers still return the old IP

Symptom: dig @8.8.8.8 shows 203.0.113.25 but a friend's network or your office still shows 192.0.2.10.

Cause: their resolver cached the record before you lowered the TTL, or you lowered it less than one old TTL before the move.

Fix: check the second column on the stale resolver, which tells you how long it will keep the copy. Keep the old server running until that reaches zero. You cannot flush other people's resolvers, only wait them out.

The flush did not change a CNAME answer

Symptom: you flushed www.example.com at Google, but it still resolves through an old CNAME (a record that says "this name is an alias of that name").

Cause: every name in the chain is cached separately.

Fix: Google's FAQ says to flush the CNAME record type for each name in the chain, starting from the last CNAME and working back to the name you queried. Then flush the queried name again for any record types that still return the stale CNAME.

The domain cannot be flushed at all

Symptom: the flush tool will not refresh your name, or the answer stays the same after every flush.

Cause: Google says domains that use EDNS Client Subnet (ECS) for geolocation cannot be flushed. ECS is a feature where the resolver passes part of the visitor's address to your DNS host so it can return a nearby server. Names with characters other than ASCII letters, digits, hyphen or underscore cannot be flushed either.

Fix: for an ECS domain, wait for the TTL to expire; Google's FAQ suggests keeping TTLs on ECS records at 15 minutes or less so flushing is never needed. For a non-ASCII name, enter its punycode form, the ASCII version that starts with xn--.

The flush form asks for a reCAPTCHA every time

Symptom: you need to flush ten names and record types, and the form makes you solve a reCAPTCHA again and again.

Cause: that is by design. Google says you cannot flush all subdomains or all record types in one go. You flush each record type for each name.

Fix: flush only what you changed. If the list is long, waiting is often less work.

dig shows the old TTL at the source

Symptom: Step 4 still shows 86400 after you saved 300.

Cause: the change did not save, you edited a zone on a server that is not authoritative, or your nameservers point somewhere else.

Fix: run dig +short example.com NS and make sure you edited the zone at those nameservers. If you are tracing a delegation problem, dig +trace example.com follows the path from the root servers down, which shows which nameservers the internet really uses.

Pro tips

  • Lower the TTL on everything you will touch, including www, mail and any AAAA records. One forgotten record with a one-day TTL ruins a clean move.
  • Query the authoritative nameserver to read the true TTL. Query a public resolver to read what visitors see.
  • Write down the before and after values so a rollback takes two minutes.
  • Do not leave TTLs at 300 forever. Short TTLs mean more lookups, and Route 53's own guide links a longer TTL to lower latency.

New to how DNS and the server fit together? Start with what web hosting is.

When to ask the host or a DNS engineer

Ask for help when the nameservers themselves are changing, when you run your own mail server, when the domain uses DNSSEC or geolocation, or when you cannot find a TTL field at all. A good host will happily lower a TTL for you and confirm it with dig.

The one message worth forwarding

Copy this, fill in the blanks and send it to your host or whoever manages your DNS.

Hi, we are moving example.com to a new server on [date and time, with time zone]. Please lower the TTL to 300 seconds on these records at least 48 hours before the move, without changing their values: example.com A, www.example.com A, and any AAAA records. Please reply once it is saved so I can confirm with dig against the authoritative nameserver. After the move we will raise the TTL again once everything is confirmed. Thank you.

Lower the TTL first, wait longer than the old TTL, then move, and the "it still shows the old server" panic mostly never arrives.

Reader questions

Can I set the TTL to zero during a move?

RFC 1035 says a zero TTL means the record should be used only for the current lookup and not cached. A short value such as 300 seconds is the common advice and puts less load on your DNS host.

Does lowering the TTL make my site faster or slower?

A short TTL means resolvers ask your DNS host more often, which can add a little lookup time for some visitors. That is why you raise it again once the move is confirmed.

Should I lower the TTL on MX records too?

If your email is moving, yes. Lower the TTL on the MX records and on the host names they point to, on the same schedule as your website records.

Is DNS propagation a real thing?

Nothing is pushed out to the internet. Resolvers simply hold cached copies until their TTL runs out, and the word propagation describes that gradual expiry.

Do I need to own the domain to use Google's Flush Cache tool?

No. Google says you do not need to prove ownership, but you must solve a reCAPTCHA for each request.

Does the TTL on my records affect a nameserver change?

A nameserver change also depends on delegation data cached by resolvers, which your zone's record TTLs do not fully control. If you are changing nameservers, ask your registrar or DNS host how long to expect and flush the main domain first at Google.

Sources & further reading

  1. RFC 1035: Domain names, implementation and specification
  2. RFC 2181: Clarifications to the DNS Specification
  3. RFC 2308: Negative Caching of DNS Queries
  4. BIND 9 manual pages: dig
  5. Google Public DNS: Get started
  6. Google Public DNS: FAQ
  7. Google Public DNS: Flush cache
  8. Amazon Route 53: Values for basic resource record sets
  9. cPanel Docs: Zone Editor
  10. Microsoft Learn: ipconfig

Originally published . About our editorial updates.

Your next project deserves a better foundation.

Explore hosting built for your next chapter.

Explore hosting

Find your next answer.

Search published guides and articles.

Ctrl / ⌘ K to open · Esc to close