Mono's DNS is broken

Fri 18 December 2015 by feld

I recently started playing around with Sonarr by porting it to FreeBSD. It's a pretty well designed app -- I'm not aware of an alternative with such a well thought-out interface and deep integration into the other programs it communicates with. I've never run program via mono before, so I was pleasantly surprised it seemed to be "just working".

However, I was checking out their forums when I stumbled upon this post indicating a mono bug regarding DNS:

How does this affect me?

This depends on which platform your running Sonarr on, for Windows users
this should be pretty seamless, the DNS records will be updated and
Sonarr will start using the new server automatically, for non-windows
users Sonarr will still point to the old server until sonarr is
restarted (this is due to a mono bug that caches dns records for the
life of the app).

Wow, that seemed weird. Sure enough, after some research I found that mono is stupid enough to have a functional DNS implementation but is not used by the ServicePointManager, a class that manages web requests. Instead, this moronic code caches DNS requests forever. Boy, that sure makes the concept of a cross-platform .NET/mono software that interacts with the internet a waste of time.

Last I checked when I talked to the Sonarr developers they are about a month in on this IP change and there are still many thousands of Sonarr installations trying to communicate with their old server they're trying to retire. Ridiculous.

I've actually found there's a patch in the mono codebase that fixes this problem, but it was never merged to the 4.2 branch; instead, it is rotting in master waiting for the next big cut which could be... well, who knows how long? sigh

If you want to help me badger them into fixing this problem, go leave some comments here.

How any software can exist this long without having a properly functional DNS implementation for when you actually interact with the internet is quite an achivement. But fear not, Java did this too through JDK 1.5!

Lets hope that Microsoft's open source .NET implementation is successful. At least that way you'll (hopefully) get an identical experience across platforms.