TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Bunny DNS – A scriptable DNS platform

243 点作者 decrypt大约 3 年前

22 条评论

franciscop大约 3 年前
I&#x27;ve been following Bunny (BunnyCDN&#x2F;Bunny.net) for a while and love what they are doing. Couple of suggestions:<p>• Every code snippet should be copy&#x2F;pasteable (and work well), that article might be the entry point to what many are doing.<p>• I have this feeling this is following Cloudflare&#x27;s Workers style of `addEventListener(&#x27;fetch&#x27;, eventHandler);`. I need to write a 500-word essay on that, but the short version is that I strongly believe that it&#x27;d be way better for their clients if the client could just do `export default async function handleDns(event) { ... }` instead of having a global (what?) context where there&#x27;s a function unattached called `addEventListener` and you need to know it&#x27;s for `&quot;dns&quot;` (is there even other possibility here?) and that the respondWith() only accepts a promise, which is not common (it&#x27;s more common to accept an async fn which then becomes a promise). Compare these two snippets, current and with my small proposal:<p><pre><code> &#x2F;&#x2F; Current API: addEventListener(&#x27;dns&#x27;, event =&gt; { event.respondWith(handleRequest(event.request)); }); function handleRequest(request) { return new TxtRecord(&#x27;Hello world!, 30); } vs &#x2F;&#x2F; Potential&#x2F;suggested API: export default function handleDns(event) { return new TxtRecord(&#x27;Hello world!, 30); } </code></pre> This way it&#x27;s easier to write, to reason about, to test, etc. It&#x27;s all advantages from the client point of view, and I understand it&#x27;s slightly more code from Bunny&#x27;s point of view but it could be done fairly trivially on Bunny&#x27;s end; they could just wrap the default export with this code on their infra level, simplifying and making dev lives a lot easier:<p><pre><code> &#x2F;&#x2F; Wrapper.js import handler from &#x27;.&#x2F;user-fn.js&#x27;; addEventListener(&#x27;dns&#x27;, event =&gt; { if (typeof handler === &#x27;function&#x27;) { event.respondWith(handler(event)); } else { &#x2F;&#x2F; Could support other basic types here, like &#x2F;&#x2F; exporting a plain TxtRecord(&#x27;Hello&#x27;, 30); throw new Error(&#x27;Only handler functions supported now&#x27;); } });</code></pre>
评论 #30700188 未加载
评论 #30703398 未加载
评论 #30708232 未加载
评论 #30701432 未加载
评论 #30699121 未加载
subhashchy大约 3 年前
We serve thousands of custom domains for our SaaS customers.<p>The end users of these domains are globally distributed and served from 14 different data centre locations across the world.<p>To do the geo IP matching we tried a lot of things, third party services etc but couldn&#x27;t find one that works well and are priced well.<p>For example, the hosted DNS service we use also have a IP based filter chain feature but are priced around $22 per domain per month as add-on.<p>At the end, we built a anycast based solution that was very painful to setup but works fine now and can use a single A record that works across the world. We had a get a ASN, a &#x2F;24 block and hell lot of back n forth with a government run org to set it up.<p>A &quot;hosted&quot; scriptable DNS server which takes the location as input and output IP of nearest edge server as output is the exact thing I needed. So yes there is definitely a niche market for it.<p>I still have to explore and see how closely bunnydns is able to get the source IP&#x2F;location (tricky) and how does health check etc could work but definitely something I would explore and consider.
评论 #30708244 未加载
评论 #30702267 未加载
xrd大约 3 年前
They had me at the combination of the words &quot;scriptable&quot; and &quot;DNS.&quot; My monkey brain is susceptible to that clever trick.<p>I&#x27;m struggling to see what this could be used for, but the comments here help.<p>In summary:<p><pre><code> - an alternative to anycast. - an alternative to routing inside your app (your app could detect the IP, and have different behavior based on rules internally). This means you are always going to the same origin, which scriptable DNS would prevent, you could put things at the edge and reduce hops. </code></pre> Why else would you use this?
评论 #30701427 未加载
评论 #30700731 未加载
freedomben大约 3 年前
Well dang, that&#x27;s what I get for taking too long to implement my idea :-D<p>Seriously this is great. I started building a &quot;scriptable DNS&quot; to make it easy to have a DNS record that always points at the valid K8s nodes in my cluster (and randomizes the order of the IPs each time). Since nodes can come and go very quickly (especially during an upgrade), and their IP changes every time, it&#x27;s useful to be able to act dynamically.<p>This is most assuredly better than what I was building though. Mine is rust-based but the &quot;script language&quot; is a very simple DSL. I considered allowing docker containers that receive some command arguments and must write the answer to standard out, but that felt like a brittle interface and I worried about performance (even with offering a cache). I also considered writing it in Elixir and allowing elixir code snippets, but I got scared of how hard it would be to secure that.<p>Anyway really neat idea! I hope to see more innovations and implementations!
评论 #30701125 未加载
评论 #30700497 未加载
danrl大约 3 年前
Like the idea. But…<p>1) Claim privacy first and then have a cookie banner.<p>2) Say “routing” when you mean location&#x2F;IP based DNS.<p>3) Is that a loosely typed language in the scripting engine? Not sure I would want DNS queries to be relying on that.<p>I am sure there is still some innovation left in DNS. SDDNS I’d call it: Software defined DNS. Especially with the splinternet we are walking into these days. Just don’t think this version cuts it. Nevertheless an interesting company to follow. I see potential.
评论 #30698909 未加载
评论 #30698845 未加载
评论 #30708251 未加载
nodomain大约 3 年前
It always puzzles me when people speak of &quot;routing&quot; in conjunction with DNS.
评论 #30698912 未加载
评论 #30701034 未加载
评论 #30698740 未加载
cryptonector大约 3 年前
Oh ffs, why does TFA refer to this as &quot;internet routing&quot;?? This is HTTP routing, or &quot;web routing&quot; if you want, but &quot;internet routing&quot; is something else entirely -- think BGP and OSPF. Is this a thing now, to refer to HTTP routing as &quot;internet routing&quot;?
评论 #30704268 未加载
评论 #30704270 未加载
IgorPartola大约 3 年前
Well this is embarrassing: <a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;VoG4N3X" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;VoG4N3X</a><p>Also routing and DNS are different things. Misunderstanding what routing is while trying to sell your technology to technologists is likely not a winning strategy.
pull_my_finger大约 3 年前
Another mature option with Lua scripting is LuaDNS[1]<p>[1]: <a href="http:&#x2F;&#x2F;www.luadns.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.luadns.com&#x2F;</a>
评论 #30703344 未加载
monkaiju大约 3 年前
For people who want to understand, learn about, or stay on top of their, DNS check out dug. Its a cli tool I made to help visualize DNS propagation but is a great learning tool.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;unfrl&#x2F;dug" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;unfrl&#x2F;dug</a><p><a href="https:&#x2F;&#x2F;dug.unfrl.com" rel="nofollow">https:&#x2F;&#x2F;dug.unfrl.com</a>
评论 #30705454 未加载
luismedel大约 3 年前
Somewhat related (and shameless plug), I coded a Lua-scriptable (Javascript planned) DNS server a while ago[0]. I&#x27;m using it in a few low traffic domains, but the code needs some additional love :-)<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;luismedel&#x2F;redns" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;luismedel&#x2F;redns</a>
评论 #30702500 未加载
mwcampbell大约 3 年前
Does location-based DNS even have a future? fly.io doesn&#x27;t seem to think so: <a href="https:&#x2F;&#x2F;fly.io&#x2F;blog&#x2F;the-5-hour-content-delivery-network&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fly.io&#x2F;blog&#x2F;the-5-hour-content-delivery-network&#x2F;</a>
评论 #30698637 未加载
评论 #30699966 未加载
unmole大约 3 年前
I have some idea about how DNS and internet routing works but I can&#x27;t think of a usecase for this.
评论 #30703617 未加载
mdasen大约 3 年前
One of the things that would be nice is if this would mean that Bunny&#x27;s Let&#x27;s Encrypt support would do wildcard certs. Right now, because Bunny doesn&#x27;t control the DNS, they can&#x27;t create wildcard certs. I know this is mostly about the scriptable DNS, but it is also an announcement that they&#x27;re entering DNS more generally.
Havoc大约 3 年前
Surprised by all the negativity and dismissiveness in the comments.<p>Bunny in general has been a positive experience for me so looking forward to trying this<p>Not so sure about the per million pricing on scriptable dns queries. Isn’t it quite easy to generate billions of dns queries? ie I hope there is some sort of ddos mitigation in front of that
tyingq大约 3 年前
This is very clever, and something I wished existed inside of AWS&#x2F;Route53. It would greatly simplify some of the work needed for redundancy&#x2F;resilience. Something similar as a locally-deployable &quot;unbound&#x2F;dnsmasq style&quot; component would be neat as well.
评论 #30701987 未加载
sigmonsays大约 3 年前
there is so much wrong with this site i thought it was april 1st.<p>i thought it&#x27;s been proven that geo-ip data is not reliable?<p>second.. DNS is not routing.
评论 #30699125 未加载
ape4大约 3 年前
The cynic in me says: oh no another scripting platform that can be compromised.<p>The programmer in me says: what cool stuff can I do with that.
Zash大约 3 年前
Looks a bit like the PowerDNS LUA records <a href="https:&#x2F;&#x2F;doc.powerdns.com&#x2F;authoritative&#x2F;lua-records&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;doc.powerdns.com&#x2F;authoritative&#x2F;lua-records&#x2F;index.htm...</a> but with JavaScript and shinier GUI?
simondanerd大约 3 年前
Can&#x27;t make an account with a .me tld in my email...
评论 #30699747 未加载
评论 #30700151 未加载
lormayna大约 3 年前
What is the difference between using Unbound + Python or PowerDNS&#x2F;dnsmasq + LUA and using this product?
kateinoigakukun大约 3 年前
The launch time of JavaScript engine is fast enough for DNS?