How To Redirect Your WAN IP Address To Your LAN Server

I. Using DigitialOcean ‘Network' settings for domains

II. Using Namecheap's ‘Advanced DNS' settings.

III. Using imarkethost.com ‘DNS Records' panel.

IV. When connecting to a local Nextcloud server using a self-signed SSL certificate

I DigitialOcean ‘Network' settings for domains

To redirect to a domain name
Create a new A record > enter domain name in the ‘host' field > enter the ip address in the ‘Will direct to' field (*1) > then click ‘Create Record'

To redirect to a subdomain name
Create a new A record > enter subdomain name in the ‘host' field > enter the ip address in the ‘Will direct to' field (*1) > then click ‘Create Record'

You may have to wait for a while for the new name to take effect but usually DigitalOcean will take only a few minutes (or less).

(*1) you can find your ip address by typing in ‘my ip address' into google or going to whatismyipaddress.com or myipaddress.com

II. Using Namecheap's ‘Advanced DNS' settings.

Click ‘Add New Record' > In the ‘Type' column, select ‘A Record' from the drop-down menu > In the ‘Host' column, enter the desired subdomain name > In the ‘Value' column, enter the ip address > then click the green check mark to save.

For a full domain name (instead of the subdomain mentioned above), create 2 records – 1 record using ‘@' in the ‘Host' field and a second record using ‘www' in the ‘host' field.

In my experience, you may have to wait longer than the other methods. Can take from 30 min to an hour for the changes to take effect.

III. Using imarkethost.com ‘DNS Records' panel.

To redirect to a subdomain
Go to ‘My Domains' > ‘DNS Records' > In the upeer right corner click ‘Add a New Record' > In the ‘Hostname' field enter your designed subdomain name > In the ‘Please select' drop-down menu, select a domain name > In the ‘Choose a Record Type' drop-down menu, select ‘A' > click the ‘Add' button.

You may have to wait for a while for the new name to take effect but usually this will take only a few minutes (or less).

IV. When connecting to a local Nextcloud server using a self-signed SSL certificate

When connecting to your local/lan nextcloud server, due to router firewall restrictions (could not find a way to disable the routers firewall settings for incoming connections to port 80 – probably by ISP design), you can only connect to via https (port 443). If you try to connect from outside of your lan for example, at my.domainname.com you will not be able to. If you are trying to connect while within your lan (on your local wifi), then you will be redirected to the local ip port (https://192.168.1.xxx) which connects ok.

The Solution
So, when you are trying to connect when outside of your lan, you will need to enter the full https address of the domain name, for example – https://my.domainname.com which takes you to the default /var/www/html page or – https://my.domainname.com/nextcloud which takes you to the default Nextcloud login page.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.