News for hackers. Stuff that matters.
Re:Chromium cleans up its act and daily DNS root server quer... by cashewchoo on Friday February 05, 2021 @11:37AM (#26038143)
I recently completed a "software pilgrimage", as I decided to call it in explaining to friends why I did it, of writing my own DNS recursive resolver. I decided to implement it purely from RFC 1034/1035, with no library code aside from TCP and UDP sockets and a JSON config parser, those kinds of things. No library help for anything relating to the RFC. It's part of a homelab-focused DNS solution that I plan to release under the AGPLv3 once I dogfood it for a while. Basically "DNS for impatient homelabbers/SMB's who don't want to have to learn how to write zonefiles and don't want some crazy enterprise omnibus thing either".

Anyway, in the process of doing this and putting it in my DHCP config and seeing the traffic from two smart TVs of different brands, my RIPE atlas probe, various phones and laptops, smart thermostat, etc etc, I've noticed that there is a TON of "garbage" dns requests. Like, the chart [the article] shows - where about 70% of queries result in a name error - that totally meshes with what I see on a much smaller scale. Right now, prometheus tells me that since last restart (which was about a week ago at this point?), I've answered 80437 queries with NO_ERROR, 52014 with NAME_ERROR, and 242 with SERVER_FAILURE (funnily enough, when spot checking these, 8.8.8.8 also SERVER_FAILUREs these same requests - usually devices with presumably-buggy dns libraries not correctly specifying lengths of variable-length fields).

It really surprised my initial suspicions that so many DNS requests would be coming up with what I was originally considering to be an error condition. But I guess sometimes the absence of a DNS record is just as meaningful as the presence.

Incidentally, I also noticed these chromium dns requests, and they had me worried for a bit because I wondered if they were malware trying to exploit some kind of vuln in dns servers. Took a bit of googling to figure it out. I do think they make up a decent % of the name errors I see, though I hadn't gotten around to having prometheus split them out to measure.

Re:Chromium cleans up its act and daily DNS root server quer... by fouronnes3 on Friday February 05, 2021 @12:32PM (#26038811)
That's a very sweet idea. What are some other "software pilgrimage" projects for ambitious hackers with a finite amount of free time?

Buying something in bitcoin using only the protocol spec and man pages? Tweeting from a Linux from scratch install? Writing a correct tar command on the first try? Writing a quine on your favorite language without google?

Re:Chromium cleans up its act and daily DNS root server quer... by cashewchoo on Friday February 05, 2021 @12:47PM (#26039027)
Heh. I was inspired by a movement I saw a while ago to read old CS academic research, since e.g. quicksort is still very relevant nowadays but is also still approachable for someone with a B.Sc. in CS. (Whereas more recent papers all require fairly deep knowledge of the research niche).

My take on it was that lots of this old software was implemented by candlelight with a magnetized needle, a 512KiB HDD platter and a steady hand; so I should be able to reimplement it in a modern language with modern tooling in a lot less time, while learning a lot about the system. Like, dig command output means a lot more to me now than it did at the start, and I now appreciate what articles like the OP mean now.

Re:Chromium cleans up its act and daily DNS root server quer... by nishanth_v on Friday February 05, 2021 @02:13PM (#26040055)
One of my friends is building a collection of such exercises aimed at experienced & intermediate programmers, where you build Redis / Docker / Git / React from scratch with guidance.

https://codecrafters.io/challenges

Re:Chromium cleans up its act and daily DNS root server quer... by maxwelljoslyn on Friday February 05, 2021 @02:28PM (#26040213)
See also: Robert Heaton's series of project prompts "Programming Projects for Advanced Beginners."

https://robertheaton.com/2018/12/08/programming-projects-for...

The project goals are not as lofty as those proposed by nishanth_v's friend, but Mr. Heaton goes the extra mile to turn each project idea into a step by step mini-curriculum with lots of extension points.

Then, he goes another extra mile by allowing readers to email in their buggy projects, and running a companion series where he teaches people how to debug / fix / improve their code by refactoring reader's attempts at the "...Advanced Beginners" projects.

Recommended.

Re:Chromium cleans up its act and daily DNS root server quer... by abhijat on Monday February 08, 2021 @02:41AM (#26061796)
I remember doing a few of these last year. It was quite fun. They even added nim on request. I was able to use it to complete the docker challenge.
Re:Chromium cleans up its act and daily DNS root server quer... by wdfx on Friday February 05, 2021 @02:30PM (#26040229)
I'm writing a software audio synthesiser.

Not quite the same as I'm not following or reimplementing any established standard, but it's interesting and fun to Greenfield a c++ project using minimal dependencies to do things like:

- invent and parse a DSL - modularise components and connections between them - possibly cyclic directed graph traversal - efficient near-real-time audio processing (working in chunks within a time budget) - multithreading / parallel module processing - spit the outputs into an audio device and/or wav files - eventually put a GUI on top

Re:Chromium cleans up its act and daily DNS root server quer... by trillic on Friday February 05, 2021 @03:25PM (#26040751)
I built (against my will) a regex engine in college and it's the toughest, most CS'y "software pilgrimage" I could think of.

In the same vein, I think building or designing some of the components in an OS or Systems book[1] could have a similar positive result.

[1] https://mitpress.mit.edu/books/elements-computing-systems-se...

Re:Chromium cleans up its act and daily DNS root server quer... by uncledave on Friday February 05, 2021 @03:37PM (#26040869)
My personal pilgrimage seems to always end up designing designing a stack virtual machine and writing a compiler for it for a toy programming language. I tend to pick this up every time I learn a new language to get a feel for it.

I usually get it to run a simple loop to print hello world and do the inevitable Fibonacci generator and get bored. No fancy things like functions!

One of these things was crudely repurposed into a domain specific language for a job as well which was handy.

Re:Chromium cleans up its act and daily DNS root server quer... by cheschire on Friday February 05, 2021 @05:31PM (#26042050)
LFS was my first tech pilgrimage as a teen. I would love to see more projects with that level of optional hand holding!
Re:Chromium cleans up its act and daily DNS root server quer... by bitxbitxbitcoin on Friday February 05, 2021 @02:28PM (#26040215)
Follow up using bitcoin using only the protocol spec and man pages with setting up a multisig wallet on testnet!
Re:Chromium cleans up its act and daily DNS root server quer... by 3np on Friday February 05, 2021 @03:14PM (#26040655)
There’s so much.

If I can dream, an LDAP implementation with a similar target as GP wound be fantastic.

That’s not a short one though (:

Re:Chromium cleans up its act and daily DNS root server quer... by the_imp on Friday February 05, 2021 @01:26PM (#26039548)
I wrote a fully spec-compliant YAML library.
Re:Chromium cleans up its act and daily DNS root server quer... by zingplex on Friday February 05, 2021 @03:42PM (#26040911)
I didn't think that was possible
Re:Chromium cleans up its act and daily DNS root server quer... by waynesonfire on Friday February 05, 2021 @07:12PM (#26042833)
bittorrent client
Re:Chromium cleans up its act and daily DNS root server quer... by justinclift on Friday February 05, 2021 @11:22PM (#26044106)
> Basically "DNS for impatient homelabbers/SMB's who don't want to have to learn how to write zonefiles and don't want some crazy enterprise omnibus thing either".

Dnsmasq or PowerDNS weren't suitable?

Re:Chromium cleans up its act and daily DNS root server quer... by cashewchoo on Monday February 08, 2021 @01:06PM (#26067913)
Workable but no, not suitable. PowerDNS has a lot of features and isn't terrifically simple to deploy. DNSMasq is easier to deploy, but still has a lot of features and isn't easy to configure.

The niche I'm aiming for is for people who just want to map hostnames to IP addresses. And note this isn't a commercial offering, just something I built for myself that I'm going to put up a website for and maybe some other people will find interesting. I do think I have some product-market fit because even among my dev friends, who are all quite talented, many of them have mentioned to me "yeah I threw bind9 on a server but decided I didn't hate typing IPs enough to actually set up and operate it".

I'm aiming for zero onboarding time and zero maintenance headache. You run a docker container, map the ports, and then there's a nice web UI that takes you the rest of the way.

Re:Chromium cleans up its act and daily DNS root server quer... by justinclift on Tuesday February 09, 2021 @12:00PM (#26079787)
No worries, that does sound useful. :)
Re:Chromium cleans up its act and daily DNS root server quer... by birdiesanders on Friday February 05, 2021 @11:48PM (#26044204)
Try running 15k containers, dnsmasq and powerdns fall over pretty fast. I have to run a BIND cluster of 3 machines to support the days when I am running at-scale testing of software (low load, but high instance count is a better fit for my work these days). I use 4th gen i7 machines as DNS resolver/caching servers, and using dnsmasq on the same machines I start to have issues around 400 clients, massive latency, broken responses, tons of crazy stuff. One BIND instance and I can get to about 7500 clients before it starts to get squeezed.

The difference is huge in other ways, though. Configuration, operations, and maintenance of the BIND cluster is 20 fold more involved, and when things break, they can break in really confusing ways. Such is the world of computing though, the better something performs, the more places it has where you can mess it up.

Re:Chromium cleans up its act and daily DNS root server quer... by justinclift on Saturday February 06, 2021 @12:25PM (#26048075)
> Try running 15k containers ...

That sounds pretty different from the audience they said they're targeting → "impatient homelabbers/SMB".

As another commenter points out though, the load you're talking about definitely sounds like something PowerDNS should handle without much problem. Given reasonably spec-ed, hardware and software that is.

It's used by some pretty big places:

https://www.powerdns.com/users.html

Re:Chromium cleans up its act and daily DNS root server quer... by mdekkers on Saturday February 06, 2021 @05:30AM (#26045623)
> [...] powerdns fall over pretty fast

If you are running a properly configured PowerDNS, and 15k containers make it fall over, you don't have a properly configured PowerDNS