Joined: 04 Oct 2007 Posts: 1258 Location: Ohio USA
Posted: Mon Aug 10, 2009 1:51 Post subject:
If you happen to have a web host hosting a website for you, and you are able to set up subdomains on it (e.g. subdomain.domain.com), you could set up a subdomain on it, and in the folder for the subdomain create an index.php file with the following code:
Code:
<?echo "Current IP Address: " . $REMOTE_ADDR ;?>
Now you have your own checkip website to program into your router. I have already done so on my website and it works great. _________________ (05/02/17) std - 31924
Linksys WRT400N
Buffalo WHR-G300N
If you happen to have a web host hosting a website for you, and you are able to set up subdomains on it (e.g. subdomain.domain.com), you could set up a subdomain on it, and in the folder for the subdomain create an index.php file with the following code:
Code:
<?echo "Current IP Address: " . $REMOTE_ADDR ;?>
Now you have your own checkip website to program into your router. I have already done so on my website and it works great.
Looks good but my ISP employs transparent proxies for port 80 and that code will return the transparent proxy's IP address. I'm not familiar with PHP but do you know what other variable's will return the right IP address?
Edit: nvm, I figured it out:
Code:
<?php
if (empty($HTTP_X_FORWARDED_FOR))
echo "Current IP Address: " . $REMOTE_ADDR ;
else
echo "Current IP Address: " . $HTTP_X_FORWARDED_FOR ;
?>
You don't need a subdomain for it, just place it in a folder and point inadyn to that folder. Example if the index.php was placed in "/whatismyip":
Joined: 07 Jun 2006 Posts: 198 Location: Oregon, US
Posted: Mon Aug 10, 2009 5:53 Post subject:
phuque99 wrote:
Code:
--ip_server_name myownserver.com:80 /whatismyip/
I tried it with my own website, but it couldn't connect. I'm using Custom settings with DNS-O-Matic. _________________ Michael
WRT54GS v1.1 with Eko JFFS + OpenVPN
I tried it with my own website, but it couldn't connect. I'm using Custom settings with DNS-O-Matic.
Perhaps if you try to be more verbose about your setup, like what is the actual link on your own website and what is your custom setting, more help can be offered.
Joined: 24 Feb 2009 Posts: 2026 Location: Sol System > Earth > USA > Arkansas
Posted: Mon Aug 10, 2009 6:00 Post subject:
Cyberian wrote:
I tried it with my own website, but it couldn't connect. I'm using Custom settings with DNS-O-Matic.
Is your own website personally hosted? The reason I ask is that if you are trying to use your site that gets redirected by the DNS you are trying to update, then that will not work. Kind of defeats the purpose when you cannot connect to yourself. _________________ E3000 22200M KongVPN K26
WRT600n v1.1 refirb mega 18767 BS K24 NEWD2 [not used]
WRT54G v2 16214 BS K24 [access point]
Try Dropbox for syncing files - get 2.5gb online for free by signing up.
Read! Peacock thread
*PLEASE* upgrade PAST v24SP1 or no support.
I agree. This really isn't a major change. It would be quite easy to modify the IP addressing checking code in INADYN to simply look in nvram for the WAN IP address. It seems a bit wasteful to ping an external web site for information that in most instances the router already has...
This is not guaranteed to work. What if the WAN IP known to dd-wrt is not the actual externally reachable IP address (e.g. if there is another layer of NAT between you and the outside world)?
In order for INADYN to really know the externally visible IP address it needs to get a round trip to an external site.
Joined: 24 Feb 2009 Posts: 2026 Location: Sol System > Earth > USA > Arkansas
Posted: Mon Aug 10, 2009 21:07 Post subject:
That is why this is considered "optional". In quite a few situations, it would work. However, yes, there are quite a few situations were it would also *not* work. _________________ E3000 22200M KongVPN K26
WRT600n v1.1 refirb mega 18767 BS K24 NEWD2 [not used]
WRT54G v2 16214 BS K24 [access point]
Try Dropbox for syncing files - get 2.5gb online for free by signing up.
Read! Peacock thread
*PLEASE* upgrade PAST v24SP1 or no support.
Yes I tried myip.dnsomatic.com when I was attempting to find another IP address checking web site. For some reason the unusually great folks at dnsomatic/opendns are blocking requests from INADYN...likely on purpose. I asked them to open it up but I didn't receive a reply.
the "/" is required and tells INADYN which web page to open as the IP address checker on the web site.
Joined: 07 Jun 2006 Posts: 198 Location: Oregon, US
Posted: Thu Aug 13, 2009 2:30 Post subject:
I'm using "--cache_dir /jffs/ddns". This way, every little change doesn't result in forced update. _________________ Michael
WRT54GS v1.1 with Eko JFFS + OpenVPN
That is why this is considered "optional". In quite a few situations, it would work. However, yes, there are quite a few situations were it would also *not* work.
Yes, agreed. It should be relatively easy to add an optional feature to DDNS tab called "Use WAN IP Address" that would force INADYN on DD-WRT to check the WAN IP address stored in NVRAM and use this to update DDNS without the need to perform a round-trip check via an external web server. I've opened a bugtracker on this if anyone would like to comment or follow-up on the request: