Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My ISP gives a public and static IPv4 if you ask for it. Yes it's free.

Also, with IPv6 you have plenty of IPs...



In my case I have a dynamic IP but I use a Linux box as a router and set up Google DNS record sets for my domains and after every reconnect to Internet (or PPP connection in this case), a shell script checks to see if the IP address changed by comparing with a text file, and if it has, it updates the IP address using the gcloud CLI utility.

The DNS timeout is set relatively low, 5 minutes. I used Google Cloud DNS because it’s scalable, cheap (the setup costs under $2/month for low traffic) and has a great API and command line tool. Just took a half day of tinkering to get it all set up and most days I forget it’s there. (I should probably set up monitoring, but it’s fine most days...)

If using CloudFlare, it’s possible you could push your dynamic IP to CF as a DNS host. Haven’t looked into it yet.

And of course there’s the DynDNS approach but most of those approaches seemed more complicated or costly these days. I also use gcloud to update the DNS for LetsEncrypt roughly once a month, so it does double duty. The language for the gcloud DNS CLI tool is a bit technical but try it, test it out, and it’ll start to make more sense by example: https://cloud.google.com/sdk/gcloud/reference/dns

For a bit more security, the apps I’m running are in their own virtual machines and I’ve tried to enable default auto updates everywhere. I keep telling myself I’ll set up something more complicated to create a continuous deployment pipeline with test cases and automatic rollback but I haven’t yet gotten around to it. (Though it would be fun to set up my own virtual PPP server at some point for running test scenarios, etc.)


I am using digitalocean's dns api for similar needs. setting ext.mac.mydomain.com and int.mac.mydomain.com internal and external addresses from crontab.

since i'm using mac, you may need to change ipconfig command to hostname -i/-I)

    DO_INT={internal_record_id}
    DO_EXT={external_record_id}
    DO_BASE=https://api.digitalocean.com/v2/domains/{yourdomain}
    DO_TOKEN={your_token}
    DO_TYPE=content-type:application/json
    */15 */1  * * *  (set -o pipefail; /usr/sbin/ipconfig getifaddr en0 | curl -sX PUT -H "${DO_TYPE}" -H "Authorization: Bearer ${DO_TOKEN}" "${DO_BASE}/records/${DO_INT}" -d "{ \"data\": \"$(cat)\" }" | tee /tmp/ip.int;) &>/dev/null
    */15 */1  * * *  (set -o pipefail; curl -sf wtfismyip.com/text      | curl -sX PUT -H "${DO_TYPE}" -H "Authorization: Bearer ${DO_TOKEN}" "${DO_BASE}/records/${DO_EXT}" -d "{ \"data\": \"$(cat)\" }" | tee /tmp/ip.ext;) &>/dev/null


Hey that's really cool. On a related note, Cloudflare's API is _really_ simple. Here's a script that I used to run on several machines that would update/insert a DNS record matching hostname->public IP.

https://notryan.com/code/net/cloudflare-ddns.js


Just for those who aren't aware, Hurricane Electric has a good free DNS system at dns.he.net. Also is DDNS compatible.


there’s ddclient which can handle dynamic DNS updates. also has cloudflare integration.


You are lucky. My present ISP, Verizon, does not give static IPv4s, and hasn't even heard of IPv6 yet.

My previous ISP, Comcast, required a business plan, statics were $5/month, and they even changed the static IP on me, once. (They issued the same IP to another customer. I complained, and they told me I had to rotate.) Did have IPv6, though.


Spectrum Business quoted me a price $12/month more for a plan with a static IP vs one without. Absolutely crazy.


Oh damn, I never even thought about asking for a static IP. I should really just ask nicely...


Dang, you're lucky, I had to go on a business plan to get a static IP from Charter/Spectrum...


I have spectrum, and though it is "dynamic", I have never had it change.

A couple of thoughts though for Dynamic IP:

- I have my DNS on cloudflare, and I make a script that runs ever minute to checkif my ip changed, and if it did, than update the DNS (this was on a Cloud server and I didn't buy a static IP). - I also use pfSense, and it updates dynamic DNS as well.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: