life is too short for a diary




Resolving Netty's DNS Resolution Error on MacOS M1 Systems

Tags: macos gradle maven

Author
Written by: Tushar Sharma
Featured image for Resolving Netty's DNS Resolution Error on MacOS M1 Systems

Developers using Netty on MacOS M1 systems may encounter an error indicating a missing DNS resolver library. This error arises because Netty utilizes native code for optimal DNS resolution, and the necessary library might not be present on M1 systems.

Error

Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS. Check whether you have a dependency on 'io.netty:netty-resolver-dns-native-macos'.

Cause

Netty uses native code to interface with the system's DNS resolver for optimal performance. On MacOS systems, especially those with the M1 chip, the required native library might be missing, leading to the aforementioned error. The solution is to explicitly provide this native library.

Solution

For projects managed with Gradle, you need to include the following dependency in your build.gradle file:

Gradle

runtimeOnly("io.netty:netty-resolver-dns-native-macos:4.1.76.Final:osx-aarch_64")

Maven


comments powered by Disqus