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

The static ip is free?


I've searched far and wide haha; the cheapest I can find them is $3.50/month from Vultr. I'm almost ready to switch to DDNS though. The threat of DDOS scares me a little bit. We have 300 mbps down though, so I don't forsee it being a terrible problem. I guess I would just call my ISP if something sketchy was going on.

I'd like to imagine that my content is not DDOS-worthy though :)


Is the server doing the hosting isolated from your regular network?


Yup :) I'm running 5 KVM virtual machines, all behind a KVM NAT interface. They're not necessarily all on one laptop haha, but still on-premise. I can do live migrations between the hardware boxes with KVM without restarting the machines. Pretty cool stuff. Then they connect to a public-facing VPS that shuttles traffic to and from. I've tested out different ratelimiting strategies too. KVM's ratelimitter is surprisingly accurate. Probably gonna stick with a 10 mbps uplink and downlink pipe. Seems consistent and reliable, and still a fraction of my 300 mbps up / 30 mbps down home internet. Doubt my ISP cares about my uploading. Literally if a couple people hop on Zoom, they would be using more internet bandwidth than my servers do.


Just use Cloudflare for your name severs. Then you can have a script that runs every 5 minutes on a cron to update your dns A records via the Cloudflare API


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.


My ISP gives a "dynamic" IP, but it only changes if the router is shut off.


do you get the same IP once the lease is up?

I once had an ISP with a 3600 hour lease on a dynamic IP. For small things like game servers or short-term file hosting it may as well have been static, but the bi-annual IP change was usually pretty jarring.


I haven't had an IP change in the last year since I last restarted the router. There might be a lease time, but it is long. I also have DDNS setup




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

Search: