We currently have a website running, domain.com
but we are going to change the website and we are working on the new website under dev.domain.com

it is a wordpress system we are putting together, is there a way to setup dev.domain.com as domain.com but still not be out in the public yet?
I have tried with dns forwarding with mask (godaddy) but failed,
I also tried with a cname, but failed.

What I would like, is to have minimal downtime, simply change DNS IP records and done, but still have the team develop in a almost realistic enviroment.

thank you

Dani AI

Generated

Building on ’s DNS warning and ’s note about URL-updating plugins: the safest, fastest way to avoid public exposure and still give your team a realistic preview is to keep dev.domain.com as a private staging site and either (A) let developers view it as the real domain locally via hosts-file overrides, or (B) protect the staging site with HTTP basic auth / IP restrictions so it’s not indexed or crawled. Masked forwarding and trying to CNAME the apex commonly break WordPress URLs, cookies and SSL; they’re why you saw failures.

A quick, low-risk developer workflow (hosts-file method)

  • Each developer adds a hosts entry pointing domain.com to the staging server IP so their browser requests go to the dev server while the public still sees the live site.
# Example /etc/hosts or C:\Windows\System32\drivers\etc\hosts
203.0.113.55 domain.com www.domain.com

Use the real staging IP in place of 203.0.113.55. Remember SSL: a cert mismatch will trigger browser warnings unless the staging server is configured with a matching certificate. Also protect staging with robots: noindex and HTTP auth while you work.

Cutover checklist to minimize downtime

  • Lower DNS TTL (to ~300s) at least 24–48 hours before switching to reduce caching.
  • Prepare the site on staging and perform a serialization-safe URL swap (backup DB first). Examples: WP-CLI wp search-replace 'https://dev.domain.com' 'https://domain.com' --all-tables or a serialization-aware plugin/tool.
  • Turn off object/page caches on both servers, test permalinks and media, then update the domain A record to the new IP, purge CDN/cache, and monitor logs.
  • After switch: re-enable caches, remove staging auth, and confirm SSL + mixed-content issues are resolved.

Notes and cautions

  • Always keep full backups and test the DNS/URL changes locally (hosts file) before making them public. Velvet Blues can help update links in posts, but for database-wide changes that include serialized data use WP-CLI, Better Search Replace, or a migration plugin designed for serialization.

Recommended Answers

All 2 Replies

Just a comment about "change DNS IP records and". DNS changes have been known to take days or weeks so that change is not instant. Be sure you plan ahead for this. In other words, not an instant switch.

commented: Understood. +3

You can change the DNS of your domain to point to another domain. Normally it takes 24 to 48 hours for DNS propagation time. Next, you will also have to change the URL of your new site to point out to existing domain. For this you can take the help of plugins such as - Velvet Blues.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.