Warning: Undefined array key "hideLogo" in /var/www/dokuwiki-2023-04-04a/lib/tpl/qware-tpl/tpl_header.php on line 23
The DynDN.eS Blog

About DynDN.eS, eQmail, Gentoo & some other network stuff

User Tools

Site Tools

Warning: Undefined array key "sections" in /var/www/dokuwiki-2023-04-04a/lib/plugins/blogtng/helper/entry.php on line 1082

About "HOPS"

The actual versions of update scripts do no longer need a manual configuration of the HOPS variable!

The documentation at DynDN.eS uses the term HOPS together with our update scripts. For all who are not familiar with this term I do explain it here a bit more in detail - always related to our service. Afterwards it should not be a problem to set the correct HOPS value in the update scripts.

In general a hop is point (router) on the way to a destination. The tool to check the hops is  traceroute  (or  tracert  on Windows). An example to determine the number of hops:

$> traceroute -n -q 1 google.com
traceroute to google.de (, 30 hops max, 60 byte packets
 1 11.222 ms
 2 0.994 ms
 3 0.985 ms
 4 1.491 ms
 5 1.663 ms
 6 1.900 ms
 7 1.585 ms

There are 7 hops from the local computer to the destination “google.com”. Each hops represents a router (except the last one).

What do we call a router? A router is a machine with more than one network connection. So it can route data between the networks. In the example below you can see the incoming IP address of each of these routers. The outgoing address is impossible, but the last IP address is the one of the destination.

This ist the trick. We want to set the number of hops to the external ip address.

Maybe an example makes it more clear. Lets define that the internal network is The (dsl) router has internal IP and our computer has IP Further lets define the external IP is and we have a dynamic hostname example.us.dyndn.es created. Open a shell (command prompt):

$> traceroute -n -q 1
traceroute to (, 30 hops max, 60 byte packets 
 1 0.280 ms 
 2 1.027 ms

You see that the second hop - or better lets say the last hop - is exactly the external IP. So the value of 'HOPS' have to be set to 2 in this case.

In practice it works because we check the last good (saved) IP by using the option  -m 2  to limit the number of hops:

$> traceroute -n -q 1 -m 2
traceroute to (, 2 hops max, 60 byte packets
 1 0.280 ms
 2 1.027 ms

Determine carefully the output of the last two examples (hint: second line, “X” hops max). Otherwise all is exactly the same!

Back to the trick. If the dynamic IP was changed, the last hop (as destination) has a different IP against the last saved one - an update of the dynamic hostname have to be triggered by the script.

Just an example how the equivalent  tracert  works under Windows (note: we use the dynamic hostname instead of the IP address here):

C:\> tracert -d -h 2 example.us.dyndn.es
Tracing route to example.us.dyndn.es [] over a maximum of 2 hops:
    1    5 ms    1 ms    <1 ms
    2    1 ms    1 ms    <1 ms 
 Trace complete. 

The options are different but do the same.

The decision to determine the external IP this way was done far in the past. We have had quite often a configuration with a (dsl) router and a server behind. The issue was that the functionality to use a dynamic DNS was different between router models and sometimes unusable. With this solution we can check the dynamic IP local and remote in any case.

Checking the IP internally before trying to update saves resources on web services. In our experience this process runs stable for the given scenario with very rarely exceptions.