Dev News Daily ENDE

Vincent Bernat moves his blog's geo-DNS from Route 53 to Bunny's scriptable DNS

Vincent Bernat has written up, on 6 November, how he replaced Amazon CloudFront and Route 53 for his blog with Bunny.net, a CDN and DNS provider based in Slovenia. The trigger was price: Route 53 bills per zone, per million geolocation queries and per health check, plus a monthly KMS key to sign zones with DNSSEC, while Bunny DNS is almost free for up to 500 domains.

The blog runs on seven small NixOS virtual machines in Paris, Nuremberg, Ashburn, Singapore, San Jose, São Paulo and Sydney. Bunny's scriptable DNS runs a piece of user-supplied JavaScript on every query, so Bernat's script picks the closest alive server from the resolver's location and returns it together with the next closest, letting the browser fall back if the first one is down.

Returning two addresses had a cost. A reader in Buenos Aires would receive São Paulo and Ashburn, and since resolvers shuffle the order, could end up loading from the far one. He tested the HTTPS DNS record from RFC 9460, which lets a browser try servers in priority order, but found Chrome ignores records whose target is not the zone itself and Bunny does not return the extra addresses in the same answer. The compromise: when the second server is at least twice as far and more than 1,000 miles beyond the first, the script returns only the nearest, with a two-minute TTL; otherwise both, with one hour.

Two jobs left Bunny. The zone that answers DNS-01 certificate challenges moved to Hickory, a DNS server written in Rust, because Bunny cannot restrict access to a single zone, and the parent zone went to deSEC because Bunny cannot publish a DS record.

Vincent Bernat moves his blog's geo-DNS from Route 53 to Bunny's scriptable DNS
Vincent Bernat moves his blog's geo-DNS from Route 53 to Bunny's scriptable DNS — Dev News Daily

What it means

Scriptable DNS turns routing policy into ordinary code, which is cheaper to change than a provider's fixed menu. The post is also a reminder that the newest record types still depend on what browsers actually honour.

Written by Victoria Shinder.