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.

  • possible duplicate of [WOL - Wake On Lan over internet](http://superuser.com/questions/266009/wol-wake-on-lan-over-internet) – Oliver Salzburg May 27 '12 at 11:56
  • has nothing to do with that. my question is simple, can I use domain instead of IP address. –  May 27 '12 at 12:00
  • Sandro, DNS resolution is something that happens at the source - it has nothing to do with the configuration of your router. So if your dyndns account is resolving correctly, it should work. – Paul May 27 '12 at 12:54

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
  • 116,650
  • 19
  • 182
  • 266
  • What do UDP ports 7 and 9 have to do with that? WOL packets are sent as a simple broadcast, so you can't even add a NAT rule – what would the destination of that NAT rule be if the target device has no IP? – slhck May 27 '12 at 11:27
  • The UDP ports matter in my case, because sending it across subnets and needing IPhelper rules to send these from one specific subnet between routers of the other various subnets --> https://superuser.com/questions/295325/does-it-matter-what-udp-port-a-wol-signal-is-sent-to – Vomit IT - Chunky Mess Style Jul 21 '23 at 12:38
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
  • 86,445
  • 63
  • 260
  • 306
  • that's what I was thinking. but I cannot find program to that sends magic packet via domain instead of IP. All of them error out, so i was thinking there could be a reason non of them thought of including it as a feature. –  May 27 '12 at 12:20
  • @SandroDzneladze: Is the dyndns address resolved to the correct IP address? Otherwise, the problem is with the WOL application. The application assumes it is always used on a LAN and, thus, has no DNS support maybe. In that case, just resolve the dyndns address **locally**. There is no need to connect to your router to get its public address. – Oliver Salzburg May 27 '12 at 12:25
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