Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an ISP that serves semi-permanent IPv4 addresses. They can't promise fixed IP addresses, but unexpected changes are quite rare.

This begs me to ask however: what would be the easiest/most reliable way to track my home IP address so I can access my (Windows 7) home server even in the case of an address change?

Please note: for reasons that I don't want to go in to, I'd like to avoid using any "dynamic DNS" type services. Instead I'd prefer some way to perhaps have the home server leave an occasional/triggered "address stamp" on a remote, off-site server (by SSH, HTTP POST or similar, preferably over an encrypted connection).

share|improve this question

migrated from serverfault.com Feb 21 '11 at 20:21

This question came from our site for system and network administrators.

1  
Which OS are you running? If it is a unix like system you could write a shell script which is run by cron every now and then. The script simply needs to connect to your other servers and write the IP to an text file. I guess you could even write a script for a windows system. –  Darokthar Feb 21 '11 at 21:05
    
@Darokthar: In this case Windows (7), which is a bit of an obstacle for me. I would probably not have too much trouble whipping something up in Bash, but I'm not that familiar with Windows shell scripting. –  oKtosiTe Feb 21 '11 at 21:09
    
Then maybe you should rephrase your question. As this would be your solution :-) I'm sorry i couldn't write that script too. –  Darokthar Feb 21 '11 at 21:14
    
What kind of router are you using? I know you've said you don't want to use dynamic dns like software. But several routers have this built in so you won't need to install it on your server. I think this would be more reliable than anything you could knock up. –  Matt H Feb 22 '11 at 8:33

9 Answers 9

up vote 4 down vote accepted

Interesting question. Since you wish to avoid DNS services, I guess it would be fairly easy to knock up a script/batch file to check the current IP address and then to send a note of it to a foreign server via ssh/scp/rsync when it changes.

You can get your WAN IP address returned to you thus:

wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]|.]//g'

It would be easy to have this end up in a variable or file and then you can check for changes and trigger a report as necessary.

This has already been covered elsewhere so if you don't want to reinvent the wheel, have a look here:

http://ubuntuforums.org/archive/index.php/t-526176.html

Edit: Darn, I see you just added that you are using Windows!!!

Edit 2: Much as I hate just linking - there is a DOS/cmd-based solution to the problem here that uses DOS versions of curl and blat (to send an email):

http://www.answerbag.com/q_view/1988422

share|improve this answer
    
That looks quite close to what I want. If I can't find a Windows-specific solution, I'll try building on this with Cygwin or similar. Thanks! –  oKtosiTe Feb 21 '11 at 21:23
    
Yes, sorry about that, not sure how I could've forgotten to add that essential piece of information... I'm not even in the habit of using Windows for servers, but was interoperability demanded it in this case. That second edit also looks promising, will definitely give that a try. –  oKtosiTe Feb 21 '11 at 21:34
1  
I don't really have an answer, but something you could build uses a little of vbscript's httpwebrequest: 808.dk/?code-vbnet-httpwebrequest - It's pretty simple and straight forward, though I don't understand why you don't use a dyndns service. ;-) –  Till Feb 22 '11 at 0:45

The oldest and probably most reliable way to bind a dynamic (or any kind) of IP to a domain name is DynDNS. You have clients for almost any operating system, and once it's set up, it will run for years without you noticing anything.

share|improve this answer
    
Thanks, but I'm not interested in using DynDNS or any similar service binding my IP address to a hostname. –  oKtosiTe Feb 21 '11 at 20:35
6  
@oKtosiTe, using ddns by far the easiest solution as Julien has pointed out. There are basically no disadvantages. You need a 3rd party that both you and your server can reliably access, your server then updates that 3rd party with the IP, and you get the IP from that 3rd party. This is exactly what ddns through someone like DynDNS implements. It is your option to reinvent the wheel if you like however. –  Chris S Feb 21 '11 at 20:41
    
Having to install their client application is one disadvantage, and being dependent on such a third party is something I'd like to avoid. I have several domain names and reliable SSH, FTP and web servers of my own which I'd prefer to use if at all possible. –  oKtosiTe Feb 21 '11 at 20:49
    
@oKtosiTe - Most of these services allow you to map your own domain names to the IP as well. –  Joel Coehoorn Feb 21 '11 at 20:56
3  
If you run a router with DDWRT or Tomato firmware they have built in dyndns software so you won't need to run any client software locally. –  Matt H Feb 22 '11 at 8:28

You might be able to schedule your client machine (Windows 7?) to ftp or ssh to your server using a fake username and password every hour. If you use a unique username, you can track it in your server log files.

I have a Linux ssh server. The /var/log/auth.log file shows entries like this for failed login attempts:

Feb 11 14:51:27 hostname sshd[3864]: Failed password for invalid user alias from xxx.xxx.xxx.xxx port 28708 ssh2

Which shows the username of the attempted login and the IP address.

If your Windows 7 system got stolen, there is no danger of them getting the password for your server since your using fake credentials. The failed login attempt leaves just enough information on the server for you to be able to track your client system (unique username and the IP address where it came from).

You can use the Windows Scheduler but I would personally use the "at" command since most people don't know about it.

share|improve this answer
    
Not a bad idea at all. Will see which of my off-site servers could help me in such a fashion. Thanks! –  oKtosiTe Feb 21 '11 at 22:06

An interesting solution: if you use a Gmail account, you can leave it open in your home computer, and it will automatically logs you ip address every few hours.

You can check your account activity, including ip addresses, scrolling all the way down in your gmail inbox.

share|improve this answer
    
Genius idea. :) –  JFW Feb 22 '11 at 10:10
    
Not a bad idea at all. –  oKtosiTe Feb 22 '11 at 12:13
    
+1000 this is so clever :D –  JoséNunoFerreira Feb 22 '11 at 14:03

You can use the dyndns service without using the hostname, if that's your concern. Since your IP is "semi-permanent", I'm assuming you just know it most of the them. On those rare occasions that it changes, just log in to the dyndns site to check your account and it will tell you the new IP address. No hostname required.

When it comes down to it, an IP address is just a number. There's nothing built into the system that will allow you to know about IP changes unless you rely on some third party service somewhere outside of your own network to record those changes. The dynamic dns services (and there are more options than just dyndns.org) are the established, mature, and free means to accomplish this. If you don't want to use the domain name that goes with them, you don't have to (though it the name will still exist and work if you need it).

share|improve this answer
    
I'm aware of that, but I'd like to be able to choose the third party I'm relying on, and if at all possible, use one of my own server as one. –  oKtosiTe Feb 21 '11 at 20:52
    
@oKtosTE - I specifically mentioned in my post that there are several different dynamic dns services you can choose from. The one thing you can't do is use your own server inside your network. You must rely on some known service with a real permanent address outside of your network. There is no other way. If you really want to do this yourself you could set up an account with a cloud provider like amazon ec2 and build your own... but that's a whole lot of work and money for something that you still have to maintain and won't work as well. –  Joel Coehoorn Feb 21 '11 at 20:55
    
I have servers off-site. Guess I should've stated that more clearly. –  oKtosiTe Feb 21 '11 at 20:59

http://www.gearboxcomputers.com/products/ip-watcher/ looks like what you are looking for, even though it's not freeware.

share|improve this answer
    
+1: Although I'm hoping for a free solution, someone may definitely be served by this. Thank you. –  oKtosiTe Feb 21 '11 at 21:59

DHCP usually has a hook that can be used to call a script whenever state changes. You just need to script it to update something on your server on the other network.

What that is is up to you as you don't seem to be interested in the standard DNS solution. (You may be able to point a DNS update script at one of your servers. Sending an email on IP address change might be sufficient for your case. Copying a file or contacting a server or port on the other server is another option.

share|improve this answer

https://secure.logmein.com/ - Any machine you connect to their service (which is encrypted) you can go to the properties of that machine on their site and find it's most recent broadcast address.

Also gives you a remote desktop tool, should you need it.

share|improve this answer

if you go to: http://www.ipchicken.com/ against "Name Address:" there should be a long string - you can use that string as a host name to connect to your site.

Just save this string somewhere

share|improve this answer
    
The host name will change at the same time the IP address does, so I'm afraid this will not help me. –  oKtosiTe Feb 22 '11 at 19:00
    
some ISP don't include IP in that name and it stays unchanged - mine stays stable: "CPE0016bxxxxb6e-CM00xxxxxxx1e2.cpe.net.cable.rogers.com" –  jet Feb 22 '11 at 23:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.