Access site without DNS setup

Hello,

Is there any way to access a site before the DNS is updated? I need to keep the site available on the other server whist working on the new one. With cPanel you can access sites using http://IP/~username format, is something similar available on Virtualmin?

Thanks

1 Like

Virtualmin offers a Preview Website option at Virtualmin → Web Configuration.

Of course, you can access a website hosted on Virtualmin even if the DNS of the domain points to some other IP address - just edit the host file on the PC on which you wish to access the website.

This is an old and useful little trick.

1 Like

Thanks for the tips, the preview option only works if logged in so that wasn’t suitable, I’ve opted for the hosts trick and it’s done the job.

Thanks!

UserDir (~username) is not safe in a shared hosting environment. I’m surprised cPanel lets you do it.

Virtualmin can setup a Server Alias in whatever parent domain you want, so you could have newdomain.yourdomain.tld.

I usually create an alias in the domain and use that instead. By that I mean, create the domain as it will be when it goes into production (domain.tld) and an alias within that Virtual Server for, e.g. dev.domain.tld. You then browse to dev.domain.tld until you’re ready to switch, at which point you delete the alias and update DNS to point domain.tld to the new server.

And, as noted by calport, you can also adjust your local hosts file.

1 Like

Its in this documentation

OK, but it’s still not safe to allow users to run applications in a UserDir.

Anyway, what cPanel does is irrelevant. Virtualmin is not cPanel.

Thanks for these other options, I’ll look into these as well.
Apprecite the tips!

Cheers

Just a reminder to clear the entries from your hosts file once teh domain points to thenew place. I always forget, and it always causes me problems “Why isn’t thist working!!!” when the site moves again months/years later and it’s in my host file still :slight_smile:

Thanks for the tip, yep i’ll remember to remove it :slight_smile: