frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

What came first: the CNAME or the A record?

https://blog.cloudflare.com/cname-a-record-order-dns-standards/
121•linolevan•2h ago

Comments

charcircuit•2h ago
Random DNS servers and clients being broken in weird ways is such a common problem and will probably never go away unless DNS is abandoned altogether.

It's surprising how something so simple can be so broken.

patrickmay•1h ago
A great example of Hyrum's Law:

"With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody."

combined with failure to follow Postel's Law:

"Be conservative in what you send, be liberal in what you accept."

mmastrac•1h ago
Postel's law is considered more and more harmful as the industry evolved.
n2d4•1h ago
Very much so. A better law would be conservative in both sending and accepting, as it turns out that if you are liberal in what you accept, senders will choose to disobey Postel's law and be liberal in what they send, too.
esafak•1h ago
I think it is okay to accept liberally as long as you combine it with warnings for a while to give offenders a chance to fix it.
dotancohen•1h ago
The Python 3 community was famously divided on that matter, wrt Python 3. Now that it is over, most people on the "accept liberally" side of the fence have jumped sides.
hdjrudni•1h ago
"Warnings" are like the most difficult thing to 'send' though. If an app or service doesn't outright fail, warnings can be ignored. Even if not ignored... how do you properly inform? A compiler can spit out warnings to your terminal, sure. Test-runners can log warnings. An RPC service? There's no standard I'm aware of. And DNS! Probably even worse. "Yeah, your RRs are out of order but I sorted them for you." where would you put that?
esafak•50m ago
> how do you properly inform?

Through the appropriate channels; in-band and out-of-band.

psnehanshu•56m ago
Warnings are ignored. It's much better to fail fast.
CodesInChaos•49m ago
That depends on how Postel's law is interpreted.

What's reasonable is: "Set reserved fields to 0 when writing and ignore them when reading." (I heard that was the original example). Or "Ignore unknown JSON keys" as a modern equivalent.

What's harmful is: Accept an ill defined superset of the valid syntax and interpret it in undocumented ways.

ajross•16m ago
That's true, but sort of misses the spirit of Hyrum's law (which is that the world is filled with obscure edge cases).

In this case the broken resolver was the one in the GNU C Library, hardly an obscure situation!

The news here is sort of buried in the story. Basically Cloudflare just didn't test this. Literally every datacenter in the world was going to fail on this change, probably including their own.

frumplestlatz•1h ago
Given my years of experience with Cisco "quality", I'm not surprised by this:

> Another notable affected implementation was the DNSC process in three models of Cisco ethernet switches. In the case where switches had been configured to use 1.1.1.1 these switches experienced spontaneous reboot loops when they received a response containing the reordered CNAMEs.

... but I am surprised by this:

> One such implementation that broke is the getaddrinfo function in glibc, which is commonly used on Linux for DNS resolution.

Not that glibc did anything wrong -- I'm just surprised that anyone is implementing an internet-scale caching resolver without a comprehensive test suite that includes one of the most common client implementations on the planet.

kayson•1h ago
> However, we did not have any tests asserting the behavior remains consistent due to the ambiguous language in the RFC.

Maybe I'm being overly-cynical but I have a hard time believing that they deliberately omitted a test specifically because they reviewed the RFC and found the ambiguous language. I would've expected to see some dialog with IETF beforehand if that were the case. Or some review of the behavior of common DNS clients.

It seems like an oversight, and that's totally fine.

bombcar•1h ago
I took it as being "we wrote the tests to the standard" and then built the code, and whoever was writing the tests didn't read that line as a testable aspect.
kayson•1h ago
Fair enough.
supriyo-biswas•1h ago
My reading of that statement is their test, assuming they had one, looked something like this:

    rrs = resolver.resolve('www.example.test')
    assert Record("cname1.example.test", type="CNAME") in rrs
    assert Record("192.168.0.1", type="A") in rrs
Which wouldn't have caught the ordering problem.
hdjrudni•47m ago
It's implied that they intentionally tested it that way, without any assertions on the order. Not by oversight of incompetence, but because they didn't want to bake the requirement in due to uncertainty.
renewiltord•1h ago
Nice analysis. Boy I can’t imagine having to work at Cloudflare on this stuff. A month to get your “small in code” change out only to find some bums somewhere have written code that will make it not work.
stackskipton•1h ago
Or when working on massive infrastructure like this, you write plenty of tests that would have saved you a month worth of work.

They write reordering, push it and glibc tester fires, fails and you quickly discover "Crap, tests are failing and dependency (glibc) doesn't work way I thought it would."

renewiltord•1h ago
I suspect that if you could save them this time, they'd gladly pay you for it. It'll be a bit of a sell, but they seem like a fairly sensible org.
ShroudedNight•1h ago
I'm not an IETF process expert. Would this be worth filing errata against the original RFC in addition to their new proposed update?

Also, what's the right mental framework behind deciding when to release a patch RFC vs obsoleting the old standard for a comprehensive update?

hdjrudni•52m ago
I don't know the official process, but as a human that sometimes reads and implements IETF RFCs, I'd appreciate updates to the original doc rather than replacing it with something brand new. Probably with some dated version history.

Otherwise I might go to consult my favorite RFC and not even know its been superseded. And if it has been superseded with a brand new doc, now I have to start from scratch again instead of reading the diff or patch notes to figure out what needs updating.

And if we must supersede, I humbly request a warning be put at the top, linking the new standard.

ShroudedNight•9m ago
At one point I could have sworn they were sticking obsoletion notices in the header, but now I can only find them in the right side-bar:

https://datatracker.ietf.org/doc/html/rfc5245

I agree, that it would be much more helpful if made obvious in the document itself.

It's not obvious that "updated by" notices are treated in any more of a helpful manner than "obsoletes"

therein•1h ago
After the release got reverted, it took an 1hr28min for the deployment to propagate. You'd think that would be a very long time for CloudFlare infrastructure.
steve1977•51m ago
They had to update all the down detectors first.
tuetuopay•47m ago
Given the seriousness of outages they make with instant worldwide deploys, I’m glad they took it calmly.
rhplus•38m ago
We should probably all be glad that CloudFlare doesn't have the ability to update its entire global fleet any faster than 1h 28m, even if it’s a rollback operation.

Any change to a global service like that, even a rollback (or data deployment or config change), should be released to a subset of the fleet first, monitored, and then rolled out progressively.

steve1977•1h ago
I don't find the wording in the RFC to be that ambiguous actually.

> The answer to the query, possibly preface by one or more CNAME RRs that specify aliases encountered on the way to an answer.

The "possibly preface" (sic!) to me is obviously to be understood as "if there are any CNAME RRs, the answer to the query is to be prefaced by those CNAME RRs" and not "you can preface the query with the CNAME RRs or you can place them wherever you want".

paulddraper•1h ago
100%

I just commented the same.

It's pretty clear that the "possibly" refers to the presence of the CNAME RRs, not the ordering.

a7b3fa•35m ago
I agree with you, and I also think that their interpretation of example 6.2.1 in the RFC is somewhat nonsensical. It states that “The difference in ordering of the RRs in the answer section is not significant.” But from the RFC, very clearly this comment is relevant only to that particular example; it is comparing two responses and saying that in this case, the different ordering has no semantic effect.

And perhaps this is somewhat pedantic, but they also write that “RFC 1034 section 3.6 defines Resource Record Sets (RRsets) as collections of records with the same name, type, and class.” But looking at the RFC, it never defines such a term; it does say that within a “set” of RRs “associated with a particular name” the order doesn’t matter. But even if the RFC had said “associated with a particular combination of name, type, and class”, I don’t see how that could have introduced ambiguity. It specifies an exception to a general rule, so obviously if the exception doesn’t apply, then the general rule must be followed.

Anyway, Cloudflare probably know their DNS better than I do, but I did not find the article especially persuasive; I think the ambiguity is actually just a misreading, and that the RFC does require a particular ordering of CNAME records.

inopinatus•30m ago
The article makes it very clear that the ambiguity arises in another phrase: “difference in ordering of the RRs in the answer section is not significant”, which is applied to an example; the problem with examples being that they are illustrative, viz. generalisable, and thus may permit order ambiguity everywhere, and in any case, whether they should or shouldn’t becomes a matter of pragmatic context.

Which goes to show, one person’s “obvious understanding” is another’s “did they even read the entire document”.

All of which also serves to highlight the value of normative language, but that came later.

taeric•24m ago
Isn't this literally noted in the article? The article even points out that the RFC is from before normative words were standardized for hard requirements.
forinti•1h ago
> While in our interpretation the RFCs do not require CNAMEs to appear in any particular order, it’s clear that at least some widely-deployed DNS clients rely on it. As some systems using these clients might be updated infrequently, or never updated at all, we believe it’s best to require CNAME records to appear in-order before any other records.

That's the only reasonable conclusion, really.

hdjrudni•58m ago
And I'm glad they came to it. Even if everyone else is wrong (I'm not saying they are) sometimes you just have to play along.
sebastianmestre•1h ago
I kind of wish they start sending records in randomized order to take out all the broken implementations that depend on such a fragile property
paulddraper•1h ago
> RFC 1034, published in 1987, defines much of the behavior of the DNS protocol, and should give us an answer on whether the order of CNAME records matters. Section 4.3.1 contains the following text:

> If recursive service is requested and available, the recursive response to a query will be one of the following:

> - The answer to the query, possibly preface by one or more CNAME RRs that specify aliases encountered on the way to an answer.

> While "possibly preface" can be interpreted as a requirement for CNAME records to appear before everything else, it does not use normative key words, such as MUST and SHOULD that modern RFCs use to express requirements. This isn’t a flaw in RFC 1034, but simply a result of its age. RFC 2119, which standardized these key words, was published in 1997, 10 years after RFC 1034.

It's pretty clear that CNAME is at the beginning.

The "possibly" does not refer to the order but rather to the presence.

If they are present, they are are first.

NelsonMinar•1h ago
It's remarkable that the ordinary DNS lookup function in glibc doesn't work if the records aren't in the right order. It's amazing to me we went 20+ years without that causing more problems. My guess is most people publishing DNS records just sort of knew that the order mattered in practice, maybe figuring it out in early testing.
pixl97•1h ago
I think it's more of a server side ordering, in which there were not that many DNS servers out there, and the ones that didn't keep it in order quickly changed the behavior because of interop.

CNAMES are a huge pain in the ass (as noted by DJB https://cr.yp.to/djbdns/notes.html)

silverwind•1h ago
It's more likely because the internet runs on a very small number of authorative server implementations which all implement this ordering quirk.
tuetuopay•45m ago
Many rightfully interpret the RFC as "CNAME have to be before A", but the issue persists inbetween CNAMEs in the chain as noted in the article. If a record in the middle of the chain expires, glibc would still fail if the "middle" record was to be inserted between CNAMEs and A records.

It’s always DNS.

seiferteric•38m ago
Now that I have seemingly taken on managing DNS at my current company I have seen several inadequacies of DNS that I was not aware of before. Main one being that if an upstream DNS server returns SERVFAIL, there is no distinction really between if the server you are querying is failed, or the actual authoritative server upstream is broken (I am aware of EDEs but doesn't really solve this). So clients querying a broken domain will retry each of their configured DNS servers, and our caching layer (Unbound) will also retry each of their upstreams etc... Results in a bunch of pointless upstream queries like an amplification attack. Also have issue with the search path doing stupid queries with NXDOMAIN like badname.company.com, badname.company.othername.com... etc..
mdavid626•11m ago
I would expect, that dns servers like 1.1.1.1 at this scale have integration tests running real resolvers, like the one in glibc. How come this issue was discovered only in production?

Letter from a Birmingham Jail [King, Jr.] (1963)

https://www.africa.upenn.edu/Articles_Gen/Letter_Birmingham.html
173•hn_acker•50m ago•30 comments

Nonviolence

https://kinginstitute.stanford.edu/nonviolence
35•rkp8000•34m ago•8 comments

What came first: the CNAME or the A record?

https://blog.cloudflare.com/cname-a-record-order-dns-standards/
123•linolevan•2h ago•43 comments

Conditions in the Intel 8087 floating-point chip's microcode

https://www.righto.com/2025/12/8087-microcode-conditions.html
39•diogotozzi•4d ago•7 comments

Show HN: Pipenet – A Modern Alternative to Localtunnel

https://pipenet.dev/
62•punkpeye•3h ago•11 comments

Fix Your Robots.txt or Your Site Disappears from Google

https://www.alanwsmith.com/en/37/wa/jz/s1/
67•bobbiechen•3h ago•39 comments

CSS Web Components for marketing sites (2024)

https://hawkticehurst.com/2024/11/css-web-components-for-marketing-sites/
71•zigzag312•4h ago•28 comments

Notes on Apple's Nano Texture

https://jon.bo/posts/nano-texture/
14•dsr12•1h ago•3 comments

Bypassing Gemma and Qwen safety with raw strings

https://teendifferent.substack.com/p/apply_chat_template-is-the-safety
62•teendifferent•14h ago•8 comments

GLM-4.7-Flash

https://huggingface.co/zai-org/GLM-4.7-Flash
268•scrlk•4h ago•80 comments

San Francisco coyote swims to Alcatraz

https://www.sfgate.com/local/article/san-francisco-coyote-alcatraz-21302218.php
85•kaycebasques•17h ago•12 comments

Sending Data over Offline Finding Networks

https://cc-sw.com/find-my-and-find-hub-network-research/
12•findmysanity•5d ago•0 comments

Americans Are the Ones Paying for Tariffs, Study Finds

https://www.wsj.com/economy/trade/americans-are-the-ones-paying-for-tariffs-study-finds-e254ed2e
28•throw0101d•25m ago•9 comments

Apple testing new App Store design that blurs the line between ads and results

https://9to5mac.com/2026/01/16/iphone-apple-app-store-search-results-ads-new-design/
203•ksec•3h ago•129 comments

A decentralized peer-to-peer messaging application that operates over Bluetooth

https://bitchat.free/
504•no_creativity_•12h ago•290 comments

From Nevada to Kansas by Glider

https://www.weglide.org/flight/978820
9•sammelaugust•3d ago•0 comments

A Brief History of Ralph

https://www.humanlayer.dev/blog/brief-history-of-ralph
27•dhorthy•2h ago•18 comments

Iterative image reconstruction using random cubic bézier strokes

https://tangled.org/luthenwald.tngl.sh/splined
49•luthenwald•4d ago•14 comments

Folding NASA Experience into an Origamist's Toolkit

https://spinoff.nasa.gov/Folding_NASA_Experience_into_an_Origamist%E2%80%99s_Toolkit
64•andsoitis•2d ago•4 comments

There Is No Comfortable Reading Position

https://slate.com/life/2026/01/body-books-reading-position-posture-pain.html
31•oumua_don17•1h ago•31 comments

The Microstructure of Wealth Transfer in Prediction Markets

https://www.jbecker.dev/research/prediction-market-microstructure
113•jonbecker•4h ago•89 comments

Radboud University selects Fairphone as standard smartphone for employees

https://www.ru.nl/en/staff/news/radboud-university-selects-fairphone-as-standard-smartphone-for-e...
457•ardentsword•11h ago•216 comments

Show HN: Subth.ink – write something and see how many others wrote the same

https://subth.ink/
6•sonnig•1h ago•0 comments

Robust Conditional 3D Shape Generation from Casual Captures

https://facebookresearch.github.io/ShapeR/
40•lastdong•8h ago•4 comments

Luxury Yacht is a desktop app for managing Kubernetes clusters

https://github.com/luxury-yacht/app
52•mooreds•5d ago•23 comments

Cows Can Use Sophisticated Tools

https://nautil.us/the-far-side-had-it-all-wrong-cows-really-can-use-sophisticated-tools-1262026/
66•Tomte•3h ago•39 comments

Nepal's Mountainside Teahouses Elevate the Experience for Trekkers

https://www.smithsonianmag.com/travel/nepal-mountainside-teahouses-elevate-experience-trekkers-he...
100•bookofjoe•4d ago•38 comments

MTOTP: Wouldn't it be nice if you were the 2FA device?

https://github.com/VBranimir/mTOTP/tree/develop
69•brna-2•11h ago•85 comments

Flux 2 Klein pure C inference

https://github.com/antirez/flux2.c
410•antirez•1d ago•133 comments

The Code-Only Agent

https://rijnard.com/blog/the-code-only-agent
146•emersonmacro•17h ago•63 comments