Mobile app version of vmapp.org
Login or Join
Martha676

: How can I host a website on a dynamically-assigned IP address? I recently upgraded my internet to the point that it is much faster and more reliable than my current webhost. I would like to

@Martha676

Posted in: #Dns #Isp #StaticIp #WebHosting

I recently upgraded my internet to the point that it is much faster and more reliable than my current webhost. I would like to move my current domain to be hosted at home, but my IP address is dynamic. As far as I know, I only get a new IP when I restart my modem and or router (which is almost never) or when cable one (my ISP) pushes out a firmware update (rarely).

There are a few ways I can see doing this:


Convince my ISP to give me a static IP
Assign my router my current IP to force a static IP (which might work?)
Set my DNS record to my current IP address and update it on the rare occasions that it changes.


Obviously I'm hoping that the first one works, but I don't want to pay a lot of extra money (if that's what it takes) to get a static IP address.

Which of these options will work most reliably?

10.05% popularity Vote Up Vote Down


Login to follow query

More posts by @Martha676

5 Comments

Sorted by latest first Latest Oldest Best

 

@Kimberly868

You can use a service like Noip.com and your sites will be accessible, but I think google's spider's will not crawl your sites. I think they will drop you when they are given the redirect to your site. I hope I am wrong, but that is what I have been told. So, it you need for people to find you on Google's search engine, you might be out of luck. People could still see your business card and go straight to you though.

10% popularity Vote Up Vote Down


 

@Shanna517

Actually it is possible. And there is an easy way to automate it.

here's how. and a mockup script to get you started (it's fully functional)


Register an account at afraid.org and use them as your name servers. If you want free then you have to allow that others can (either request or use freely) any subdomain on your domain for whatever they want. Select that each request needs your approval, meaning you won't be giving those, and no one else will use your domain. Or just pay 5^
make no-ip or rather dyndns account and pick up one of their free subdomains for your host (since no-ip started doing monthly captcha's for free users) you will use this domain to compare it to ip which your actual domain points to
(Note, you can use just your WAN ip if you can get it, I am posting this way because some people can't get it from their routers/modems etc, it's also possible to use something like whatismyip/com/org/net whatever.
Or to simply run the update script below periodically)
Create bash or whatever script which looks something like this:



#!/bin/bash
#
#
# don't forget to setup noip service
# RIP var will be our real IP and CIP will be Current IP which afraid org #nameservers point to. #Also if you don't delete or replace the "ip.of.nameserver.here.if.you.want" with #actual name server which you want to use instead of a default one.
#Please kill me

RIP=`nslookup yourhost.dyndns.org ip.of.nameserver.here.if.you.want | grep Address: | awk 'NR==2 {print }'`
CIP=`nslookup yourdomain.com ip.of.nameserver.here.if.you.want | grep Address: | awk 'NR==2 {print }'`
if [ $RIP = $CIP ] # is ip of your dyndns/no-ip host same as your domain ip
then
echo "yay it's same" #you don't really need this, but just to ilustrate
else
echo "They are not the same, updating..."
#again you don't need this line either, but the one below uses uri you will get from
#afraid.org which you will use, for example with lynx or however you want, to update your dns entry to your current ip

lynx -dump "http://freedns(dot)afraid(dot)org/dynamic/update.php?YOUR_UNIQUE_UPDATE_CODE_GOES_HERE" > /dev/null
fi


.
3. create cron.d job that runs say once every few minutes and executes the ip.sh script mentioned above.
crontab entry should look something like this:

*/10 * * * * /path/to/script/ip.sh >/dev/null 2>&1


???
Profit!
Now you can host your domain on dynamic ip and you've done everything in 5 minutes.
I win.

10% popularity Vote Up Vote Down


 

@Lee4591628

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.

10% popularity Vote Up Vote Down


 

@Jessie594

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 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.

10% popularity Vote Up Vote Down


 

@Ogunnowo487

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme