How can I host a website on a dynamically-assigned IP address?

You can't simply assign your router a static IP to get a static IP. Most broadband providers allow you to lease a static IP from them for an extra monthly fee. But you're probably better off spending that on a decent webhost, as it'll be cheaper, less hassle, and you'll have better uptime. Plus, most residential broadband connections have really poor upstream speeds. And some even have ToS against running any kind of internet server unless you upgrade to a business plan.

However, if you're still set on hosting the site from home, you can use a dynamic DNS service that will automatically update your DNS records whenever your IP changes. Though there are significant disadvantages to this. For one, unless you set a very short TTL time, the chances of a user being routed to an old IP and not being able to get to your website are high. But if you set a very low TTL, users will have to make frequent DNS requests, which is bad for performance.


I also host a website on my local DHCP server. Even with a DHCP connection like I have my IP doesn't change if I lose power. The protocol works by checking my mac address and trying to give me my old IP back. Anytime the ISP is doing work though I typically lose my IP when my modem goes down.

How I host the site is by using no-ip.com this tells them what my IP address is even when it changes. They manage the DNS records so that when people visit www.mydomain.com it checks no-ip.com's DNS records and see my IP address to route traffic to.

My linksys now forwards www, mysqld, and ftp traffic to an internal server 192.168.15.11 for exmaple. My regular work desktop has 192.168.15.10 this way my web server can run Ubuntu/Nginx serve up the pages and I can still work from another machine on windows.

Anytime your IP changes the windows app from no-ip.com pushes the update to your no-ip.com account and your DNS is kept up to date.


Look to use a Dynamic DNS (DDNS) service, such as Dyn. A DDNS provider allows for a static domain name for dynamic IPs. The service is pretty cheap for low traffic sites. The way DDNS works is that you set up your router to periodically update the DDNS service holding your domain name with the current IP. Using DDNS at the router level is more convenient than having some sort of app running server side to essentially do the same thing. Internet users who then enter your domain name will always be redirected by the DDNS provider to the proper IP address. DD-WRT supports many different DDNS provider APIs. DynDNS is probably the most popular and Linksys and Belkin support the DynDNS API in their native firmware.