1

I can succesfully wake my server over the WAN or LAN using WOL.

However, I have a dynamic IP, so to get it up from WAN I need to ssh into the router using a dyndns subdomain, then check router the IP and then send a WOL magic packet, or login to the dyndns account and see what the current IP is. This is all rather tiresome…

Why can't I use the dyndns subdomain directly? I couldn’t find a program that would allow me to do this. Any ideas how to deal with this problem?

I'm looking for a program that will allow me to send magic packets using domain name instead of IP.

4 Answers4

2

Try setting up a nat rule for UDP port 7 and/or 9 that goes from the router to the target pc - see if that works!

This could be a security hole, so, I wouldn't recommend it - but, I am pretty sure the problem is the firewall.

William Hilsum
  • 117,648
0
wakeonlan -i $(dscacheutil -q host -a name yourdomain.com | awk -F': ' 'NR==2 { print $2 } ') MM:AA:CC:AA:DD:RR

Substitute the DNS name (yourdomain.com) and MAC address (MM:AA:CC:AA:DD:RR) with yours. Also it might be necessary to change NR==2 with another number of awk results. You can test it preliminary with executing dscacheutil -q host -a name yourdomain.com to check which result line you need.

0

Your dyndns name should resolve to the public IP of your router, so this shouldn't be a problem.

If you can use the dyndns address to connect to the router than this makes even less sense.

You should try to resolve the dyndns address:

nslookup yourname.dyndns.org

It should resolve to the same IP address as the one you pull from your router. If it doesn't than sometime is wrong with the dyndns setup (although I can't imagine what it is, unless you have multiple public IP addresses).

Usually, the name would be resolved to an IP address before any package is sent. So this shouldn't make any difference as long as the dyndns entry is updated.

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
0

My solution based on Oliver Salzburg's answer:

wakeonlan -i $(nslookup your.domain.net | awk -F': ' 'NR==6 { print $2 } ') MM:AA:CC:AA:DD:RR

kebe
  • 1