Genuine question: Which languages would you rather DNS servers/resolvers be written in?
Consequently, if you do not mind, which DNS server and resolver do you use?
[0] https://en.wikipedia.org/wiki/Unbound_(DNS_server)#History
You could always use Rust if bare-metal speed is important to you. But, as I'm sure tptacek will point out (and which I agree with), Go or Java or most other high-performance memory safe languages would be perfectly reasonable as well.
A lot of this boils down to using direct networking plumbing tricks and optimizing query handling into very fast flat memory lookups. A garbage collected language would be a terrible choice.
C is still the most common solution, but if I were writing a DNS server today, I'd go with rust.
Java - which others have suggested - definitely wouldn't work - no way you could make it anywhere near as tiny. Go is a bit better but you're still paying costs over C that add up if you're running hundreds of thousands of instances. Rust simply didn't exist when this was written. D? maaaybe, but then you just annihilated your pool of contributors. I'm not sure what the best choice would be, honestly.