Hi All,

I'm kinda suck with a problem i have. My parents have a PC that is on a internet connection that has a dynamic address. I VNC and connect to this machine remotly all the time.

The issue is the IP address changes every 4 hrs. I'm trying to think of a way to get this PC to send me a email every 4 hrs so i can get the IP out of the email headers.

Thanks In advance.

Spoontime

Dani AI

Generated

A few pragmatic options that work reliably long-term — one needs almost no maintenance, the other gives you full control on your Ubuntu box. This builds on ’s CGI idea and gives concrete steps for .

Use dynamic DNS first (simplest)

  • Register a DDNS hostname and run the provider’s updater on the remote PC or on your router. That way VNC connects to a fixed name and you never have to read emails or parse headers. Most routers support built‑in DDNS or you can run a small updater on Windows.

Server‑side logging (direct, under your control)

  • Put a tiny script on the Apache host that records the caller IP and requires a secret token. Example PHP (place in your web root and protect with a secret):
<?php
$secret = 'REPLACE_WITH_STRONG_TOKEN';
if (!isset($_GET['k']) || $_GET['k'] !== $secret) { header('HTTP/1.1 403 Forbidden'); exit; }
file_put_contents('/var/www/ip.log', date('c')." ".$_SERVER['REMOTE_ADDR']."\n", FILE_APPEND|LOCK_EX);
echo "ok";
?>

Client: schedule a simple call from the Windows PC every 4 hours. Example VBScript (save as report.vbs) works on XP and later:

Set x=CreateObject("MSXML2.XMLHTTP")
x.open "GET", "https://yourserver.example/record.php?k=REPLACE_WITH_STRONG_TOKEN", False
x.send

Then create a scheduled task (or use schtasks /Create /SC HOURLY /MO 4 /TN ipreport /TR "c:\path\report.vbs").

Security and reliability notes

  • Use HTTPS to protect the token. Rotate the token if the log shows unexpected requests. If you decide to use email instead, send the IP in the message body/subject and use an authenticated SMTP client so credentials aren’t exposed in plain text.

Recommended Answers

All 5 Replies

You could build a program that automatically sends you the IP as the subject and or content of the e-mail... this saves you the hassle of having to parse the header....

do you have an e-mail account on an SMTP server of some kind (not a web based)?

ya i have a mail account on smtp.accesscomm.ca....The problem that I see is finding a application that will email me every 4 hrs

Thanks for your responce

Standby... Working on it.

You don't by chance have a server that hosts web sites or anything do you? (so that you could have the IP uploaded to your server instead of by e-mail?)

I could quite easily run apache on my ubuntu box :)

Absolutely, if you have CGI ability, I can build a small page, and every 4 hours I can make the app on their system (guessing it's windows, right?) navigate to the small CGI, and pass it their IP. Then you could either log in and get the file, or if you set permissions, could surf to it, and get their IP. This simplifies having to sift through time stamped e-mails too. So, the IP would always be updated... let me know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.