Hacker News new | ask | show | jobs
by efortis 694 days ago
Since my IP hardly changes, I went from DDNS to an email notifying me when the IP changes with this cron:

  old_ip=`cat ~/.prev_ip`
  my_ip=`ifconfig em0 | awk '/inet/ {print $2}' 2>&1`
  my_email=me@example.com

  if [ "$my_ip" != "$old_ip" ]; then
    echo $my_ip > ~/.prev_ip
    echo $my_ip | mail -r $my_email -s "New IP: $my_ip" $my_email
  fi
2 comments

> Since my IP hardly changes...

Same. Our wireline ISPs used to issue new public IPs every 1-12 weeks. Now it's more like 6 mos to never.

I'm thinking this is due to pressure from IPv4 exhaustion and the rise of easy DDNS. There's also an overall shift - from using tech to protect profit-generating services to using lobbyists.

To share an anecdote from the before times: I was once trying to setup a VPN endpoint on a client's DSL connection. Every time I initiated the connection, their public IP would change. The lease renewal was fairly quick and I could trigger 5 changes a minute.

For me it changes reliably on every reconnect, but there are no forced reconnects, and I now have my router not restarting basically ever since I am on openwrt and am done with setting everything up.
> For me it changes reliably on every reconnect,

What kind of reconnect?

router to provider network
I did something similar, but scripted a curl command to update the DNS A/AAAA records that have a short TTL to the hostname.

It’s also trivial if you run your own nsd/bind instance.