How to Build Linux Web Server with Dynamic IP Address

freedns.afraid.org

Requirements:

  • Ubuntu GNU/Linux
  • Account at freedns.afraid.org
  • Easy Hosting Control Panel (EHCP)
  • Router

How to:

1. Install Ubuntu.

We set local IP Address to 192.168.0.1

$ sudo nano /etc/network/interfaces

Type in the following lines:


auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254

192.168.0.254 is the gateway / modem’s IP Address.

2. Install EHCP
3. Forward port 80 in your modem / router to redirect to IP Address 192.168.0.1
4. Register account at FreeDNS

freedns.afraid.org

 

 

 

 

 

 

 

 

 

 

 

 

5. Create subdomain at FreeDNS. For example: ubuntuserver.mooo.com. Input destination column with your public IP Address. You can check your public IP Address at http://whatismyip.com

add new subdomain

 

 

 

 

 

 

 

6. Create cronjob to update DNS  every 5 minutes

$ sudo crontab -e

*/5  * * * * lynx -dump http://freedns.afraid.org/dynamic/update.php?VG5LbWRxMzFVJDKGVdCd2hiNDo2NDgwMTQx > /dev/null 2>&1

The value VG5LbWRxMzFVJDKGVdCd2hiNDo2NDgwMTQx can be retrieved from http://freedns.afraid.org/dynamic/ in Direct URL link.

7. Done. Check http://ubuntuserver.mooo.com or http://your_public_ip

Keywords:

  • my book live web server
  • freedns afraid linux

4 thoughts on “How to Build Linux Web Server with Dynamic IP Address

  1. This was incredibly informational – THANK YOU.

    im partially confused what the purpose of step 6 is for, but it appears to be working so im happy 🙂

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.