I have a wordpress website hosted on my homelab that I exposed to the internet a year ago and due to my registrar Freenom having legal issues I was not able to renew the domain, I haven't had time to focus on it due to being busy however now I am planning on taking the site live again.

My current problem is I am unable to access the website even though it's currently hosted locally as the domain has expired. I've tried mapping the domain using the hosts file however it just redirects me to the apache start page

Here is what my hosts file looks Like this is on a windows client exampladomain.com

Here is the apache server config running on Ubunto Server 20.4

<VirtualHost *:80>
    ServerName exampledomain.com
    ServerAdmin admin@exampledomain
    DocumentRoot /var/www/html/exampledomain
    <Directory /var/www/html/exampledomain>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    LogLevel info ssl:warn
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

I've disabled the SSL config as the certificate is now invalid

is there an easy way to access the website using the domain without me having to setup a DNS server?

2 Answers 2


I seem to have fixed the problem by disabling secure DNS on Chrome

Settings >>> Privacy and Security >>> Security >>> Use Secure DNS

This is apparently not allowing the edits done on the hosts file which means chrome does not know how to resolve the domain


Find the IP Address of the Website use command nslookup yourdomain.com replace yourdomain.com from your expired domain

Edit the hosts File

Open Notepad as an administrator (Right-click Notepad and select Run as administrator). Open the hosts file located at C:\Windows\System32\drivers\etc\hosts.

Add an Entry to the Hosts File:

Add a new line at the end of the file with the IP address and the domain name.

Save the Hosts File:

Save the file and exit the text editor. You might need to clear your DNS cache for the changes to take effect. Windows: Open Command Prompt and run ipconfig /flushdns.

By using this above steps you can access website using hosts of expired domain.

Not the answer you're looking for? Browse other questions tagged or ask your own question.