We Built Our Own DNS Infrastructure
blog.replit.com
blog.replit.com
I wrote something on what it feels like to host an app from your editor: https://amasad.me/hosting
I last tried it 8 months ago but I get the same thing now. If it takes seconds on GitHub's free CI and fails after 10min on your platform, then I really can't use it.
The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
[1]: https://github.com/remram44/twitch-vod-syncIf you really want to use CRA on Replit, you should buy the hacker plan for $7/month which also lets you boost select repls and it will then be very usable for you: https://blog.replit.com/boosts
Sure, I can try and sell a whole different tool to my team, or accept that they just want to get things done and keep using the current tool that works everywhere but on replit.
I get where you're coming from, and I might take your advice next time I have to do something frontend-related (which hopefully I won't), but also understand that this works fine on most other tools' free tiers. In fact it builds from scratch and publishes to GitHub pages in 50s in GitHub Actions.
I get where you're coming from; you just want free stuff. Understandable. But also understand that there are people who want to operate and support different kinds of businesses. For example, we might pay a few dollars a month for someone to host a git repo: https://sourcehut.org/pricing/
Offering service actually costs money, and it has to come from somewhere.
Anything that can run a "real workload" is these days going to be heavily targeted by buttcoin miners and other abuse. Any free trial is ripe for abuse, and it becomes a cat & mouse game to try to identify and stop them before they waste all your resources. Is that fight worth fighting for a small business? Probably not. Yeah, you might lose a stingy few potential would-be customers but that may cost less than the fight. I bet most of these small businesses will be happy to refund your $7 if you try their service, find out that it's not for you, and explain your situation nicely.
Anyone abusing that free cluster, you boot over to a more constrained and throttled environment.
Appreciate the candor and thanks for the blog post. Clearly an environment like this is the future development.
You really shouldn’t slag off people who are working hard to give you something for free. And if you are, at least get your facts straight.
Integrated environments (browser IDE + CI/CD + serverless hosting) are going to be big for starter apps and quick APIs.
I spent some time reviewing Google Cloud Shell Editor, which has git support (not GitHub yet I guess) and one-click build & deployment to Google Cloud Run, which overall is a powerful integrated environment in itself.
Imo, replit should preemptively focus on improving and highlighting hosting.
One fresh thing is plenty of developers in India are hosting covid support apps on Replit. This particular app has done 1m+ hits in the past 24 hours: https://covid.army/
You can add __repl after any app to get the source: https://covid.army/__repl
Node support is A* and deno is still experimental.
This seems like it would be great for rapid prototyping.
I think: a pretty easy engineering decision.
For example the 0x20 trick. The specification for DNS is clear that you aren't supposed to care about bit 0x20 in labels. ClOWnS and cLowNs and clowns and CLOWNS are all the same label as far as DNS is concerned.
However your answers need to bit-for-bit match the question you were asked. So if you answer "ClOWns A?" with "CLOWNS A 10.20.30.40" that's a mistake, you were asked about "ClOWns" not "CLOWNS". In 1995 if your DNS server got this wrong nothing of consequence breaks. But in 2021 if you get this wrong some important things magically don't work.
The transaction IDs that should make forging DNS answers hard are very short, and so to beef that up slightly some stacks will hide more bits in the 0x20 bit of labels where they will be echo'd back by a compliant implementation. But to reap this reward they must ignore answers that get the 0x20 bits wrong, like yours.
I feel like if "You can't get this wrong" (a stronger claim that you admittedly didn't make) was true, my visits to the Let's Encrypt community site wouldn't all begin by ignoring the people whose problem is obviously just that their DNS server doesn't work properly. Some of them have problems an authority server doesn't care about, but lots of them have dumb problems you'd imagine are impossible and yet apparently people have successfully sold commercial DNS servers with those problems.
* https://tools.ietf.org/html/draft-vixie-dnsext-dns0x20
I'm not surprised that Vixie is involved. :)
It’s easy to screw up, definitely agree, but fairly clear how to fix when it’s pointed out. (I made that mistake)
Also, since DNS labels are strictly ASCII (this is why punycode exists), why converting all of them to the canonical upper case won't be a good idea?
This is why that transaction ID matters, the honest answer will copy the transaction ID verbatim from your question in the answer, so you get to pick it at random (back when I was a child it might just be a sequential counter) and your adversary has to guess it. But, alas the ID isn't very wide, so they really do have a good chance to just guess it. Hence, let's hide more random bits elsewhere in our queries to get a better chance of foiling the adversary.
How does an adversary guess what you're asking? Well, for one thing they might have chosen the question you're about to ask. When a bad guy's web site has an image at the top with <IMG SRC="http://real.website.example/header.jpg"> doesn't your web browser try to look up real.website.example to go get the image? Very predictable.
Adding mixed case matching makes it more difficult to make a lucky guess when sending a fake reply blindly.
EDIT: Found a reference:
"Turns out some customers were using a CPE router that thought ‘C0 0C’ was some kind of ‘answer starts here’ marker. And if it did not find that marker, its DNS component would crash. And at that time, PowerDNS did not compress that first response record, so there was no ‘C0 0C’."
-- https://berthub.eu/articles/posts/history-of-powerdns-2003-2...
At any rate: the possibility of breaking a 0x20-enforcing resolver scares me a lot less than depending on BIND, whose last memory corruption vulnerability was announced (checks notes) yesterday.
Switched later to OctoDNS, mostly because we didn't want to run DNS infrastructure or deal with racing updates to records: https://github.com/octodns/octodns
More people should do cool weird stuff with DNS. (And Replit should host stuff on Fly! But also the DNS stuff we're talking about.)
It's a great post, thanks for writing it.
Having used both, I'd wager replit competes with fly.
That also made it really hard to test, short of setting up a full end-to-end integration test including running powerdns (which I think we have, but isn't fully automated).
If I was building that service again, I'd definitely have a serious look into building it directly as a standalone DNS server rather than a backend for something else.
And if not (or also if you did), can you suggest documentation additions that would have helped you here?
I was just looking through the source history of the project a bit as I wasn't the original developer (I've just done some fixes; most recently fixing some things going from 4.2 to 4.4). The original code was written in 2016, when the documentation was a lot more sparse [1]. Kudos for the improvements!
I just filed a PR [2] fixing the doc issues I ran into (probably should have done that at the time).
To enumerate some things I see right now (using remote http backend):
* pdns always queries /lookup/example.com./SOA, /getAllDomainMetadata/example.com. /lookup/example.com./ANY -- in my case that seems a bit wasteful: there's no metadata, and SOA is returned in the /ANY request anyway. I'm unclear if there's a misconfiguration, something we're doing wrong, or this is just "how it works".
* If I query `some.domain.example.com.` (and we aren't serving requests for any part of that), the backend returns `{result:false}` -- and then pdns proceeds to query `domain.example.com.`, `example.com.`, `com.`, and `.` before finally returning SERVFAIL. It would be nice if (1) it didn't have to run so many queries, but also (2) my understanding is the appropriate response should be REFUSED (as this is not a general DNS resolver) -- but I don't know how to get PowerDNS to do that.
That last bit is what I've found most frustrating about working with pdns: everything feels like "just do what pdns asks and it'll sort out what it wants to do as a result" and I can't just tell it "returned REFUSED for that query". Maybe some examples would help with this?
[1] https://web.archive.org/web/20170615183449/https://doc.power...
The wasteful SOA query is a result of our internal code flow. You can reduce wasteful queries a bit with the new `consistent-backends` setting, but the SOA query will remain.
We (no longer) have a knob to disable metadata, but there's a cache that should also remember your empty response (the default value for `domain-metadata-cache-ttl` is 60 seconds).
If you have a SOA for example.com, pdns will never return REFUSED for anything inside example.com. The zone is there, so an answer must be present - either a name with records, a name with no records for that type, or the name does not exist. (The distinction between the latter two is why you mostly see ANY queries instead of the type the client asked for).
As far as I can tell, you should never be returning 'false' to anything, as that indicates failure, which is different than 'I know I do not have what you are asking for'. Think of it like this: your SQL database does not go 'oh no' when it has zero rows for you; it just gives you zero rows. A pdns remote backend should behave the same. If you return 'empty' for those lookups into domains you have nothing for, instead of false, I expect REFUSED will come out instead of SERVFAIL.
(And, if I'm correct in the previous paragraph, your PR is correct too :-) )
Thanks Connor!
Did you consider creating CNAME records with your existing DNS provider to point to the target cluster proxy for each repl.co subdomain?
And you have to use one of their package buttons to make that happen. Super frustrating that they don’t just have an button to open a web view on a port.