Spring Boot 2.4.2 - DNS Resolution Problem at start on Apple M1
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
When Spring Boot appears to hang or fail during DNS resolution on Apple M1 at startup, the real problem is usually lower in the stack than Spring itself. In practice, it is often a combination of older Java builds, native networking libraries, or architecture mismatches on Apple Silicon rather than a pure Spring Boot configuration bug.
Separate Spring from the Network Stack
Spring Boot starts many components, but DNS lookup typically happens in the JDK, the operating system resolver, or a networking library such as Netty. That means the first step is to confirm whether simple hostname lookup already has trouble outside the full application.
A quick Java check looks like this:
If this tiny program is slow or fails, the issue is broader than Spring Boot startup.
Check the JDK and Architecture First
On Apple M1, old or mismatched Java installations caused many early compatibility problems. Make sure the runtime matches the machine architecture and is not accidentally running through an older compatibility path.
Useful checks:
If the machine is arm64 but the Java setup is old, unusual, or mixed with Intel-targeted tooling, DNS and native networking problems become more plausible.
Watch for Library-Level DNS Resolvers
Some Spring Boot applications pull in libraries that replace or augment the default resolver behavior. A common example is Netty-based networking stacks. If a native macOS resolver library is missing or mismatched for Apple Silicon, startup warnings or DNS failures can surface while the app initializes clients.
That is why one fix path is often:
- upgrade the JDK
- upgrade Spring Boot and dependent networking libraries
- verify that native resolver dependencies match the machine architecture
The exact package coordinates vary by dependency stack, but the architectural principle stays the same.
Reduce the Problem to a Minimal Reproduction
Before changing many settings, strip the problem down:
- run a tiny Java DNS test
- run the Spring Boot app with minimal external integrations
- add back the networking clients one by one
That tells you whether the failure belongs to the core runtime, a resolver library, or some startup code that performs remote lookups too early.
Prefer Upgrading Over Deep Workarounds
Because the issue is tied to an older Spring Boot release on a new hardware architecture, upgrading is often more reliable than piling on system-property workarounds. If you stay pinned to the older stack, document the exact JDK, dependency versions, and machine architecture that reproduce the issue so the behavior stays understandable.
In other words, treat the problem as a compatibility boundary, not just a Spring property tweak.
Common Pitfalls
- Blaming Spring Boot alone when DNS resolution is actually failing in the JDK, OS resolver, or a networking library.
- Debugging only the full application instead of first testing basic hostname resolution with a minimal Java program.
- Running an outdated or mismatched Java environment on Apple Silicon.
- Ignoring transitive networking dependencies such as Netty that may use architecture-specific native resolver components.
- Adding random workaround flags before identifying whether the problem is runtime, dependency, or configuration related.
Summary
- Startup DNS issues on Apple M1 are often lower-level compatibility problems rather than pure Spring Boot bugs.
- Test hostname resolution with a minimal Java program first.
- Verify JDK version and architecture alignment on Apple Silicon.
- Check whether networking libraries introduce native resolver dependencies.
- Prefer dependency and runtime upgrades over ad hoc startup workarounds when possible.
Related reading
- Spring Boot 3 springdoc-openapi-ui doesn't work
- Spring boot 404 error custom error response ReST
- Spring Boot Actuator / Swagger
- Spring Boot Adding Http Request Interceptors
- Spring Boot 2.4.2 and Thymeleaf 3.0.12 - access static methods
- Spring Boot 2.5.0 generates plain.jar file. Can I remove it?
- Spring Boot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper
- Spring Boot 2 - Actuator Metrics Endpoint not working

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.