Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. HappyDns

HappyDns

MITObjective-Cv1.0.4

A flexible DNS library for Objective-C and Swift that supports system resolvers, HTTP DNS, DoH, and custom hosts.

GitHubGitHub
514 stars87 forks0 contributors

What is HappyDns?

Happy DNS for Objective-C is a DNS library that provides a unified interface for DNS resolution in iOS and macOS applications. It solves the problem of unreliable or slow DNS lookups by supporting multiple resolution methods, including system DNS, HTTP DNS, and DNS-over-HTTPS, allowing developers to optimize network performance and reliability.

Target Audience

iOS and macOS developers building network-dependent applications who need fine-grained control over DNS resolution, such as those working on streaming, real-time communication, or apps requiring high network reliability.

Value Proposition

Developers choose Happy DNS for its flexibility in supporting various DNS protocols, ease of integration with existing Objective-C or Swift codebases, and its ability to handle complex network scenarios like NAT64, making it a robust alternative to the system's default DNS resolution.

Overview

dns library for objective c

Use Cases

Best For

  • Building iOS apps that require reliable DNS resolution across different network conditions
  • Integrating HTTP DNS or DNS-over-HTTPS into Objective-C or Swift projects
  • Replacing domain names with IP addresses in URLs for performance optimization
  • Adding custom hosts or DNS fallback strategies to macOS applications
  • Providing DNS resolution compatibility for low-level C networking code in Apple ecosystem apps
  • Developing network libraries or SDKs that need configurable DNS query mechanisms

Not Ideal For

  • Cross-platform projects that need DNS resolution on Android, Windows, or web
  • Swift-only codebases preferring native Swift libraries over Objective-C dependencies
  • Applications with minimal network needs that rely solely on standard system DNS without customization
  • Teams seeking a drop-in DNS solution with zero configuration; Happy DNS requires manual resolver setup

Pros & Cons

Pros

Multi-Protocol Support

Integrates system DNS, custom servers, HTTP DNS, and DNS-over-HTTPS, allowing developers to choose optimal resolution methods for reliability, as shown with resolvers like 119.29.29.29 and DoH endpoints in the README examples.

Hosts Customization

Enables custom domain-to-IP mappings via a flexible hosts system, useful for testing or overriding DNS without code changes, mentioned as a key feature in the documentation.

URL IP Replacement

Automatically replaces domains in URLs with resolved IPs for direct IP-based requests, optimizing network performance, demonstrated in the queryAndReplaceWithIP method usage example.

C API Compatibility

Provides a getaddrinfo-compatible block for seamless integration with low-level C networking code, making it versatile for mixed-language projects, as highlighted in the usage section.

Cons

Objective-C Dependence

Written in Objective-C, which requires bridging headers or extra effort in Swift projects, and lacks a pure Swift API, potentially increasing integration complexity for modern iOS development.

Platform Limitation

Only supports iOS and macOS, making it unsuitable for cross-platform development without separate solutions for other platforms like Android or web.

Complex Configuration

Requires manual setup of multiple resolvers and network conditions, which can be error-prone and time-consuming for simple use cases, as seen in the initialization code examples.

iOS8 NAT64 Issues

Admits limitations with HTTP DNS under NAT64 in iOS8, requiring fallback to local DNS and adding complexity for legacy support, as noted in the common problems section.

Frequently Asked Questions

Quick Stats

Stars514
Forks87
Contributors0
Open Issues12
Last commit2 years ago
CreatedSince 2015

Tags

#ios#objective-c#swift-package-manager#dns#cocoa#macos#dns-over-https#networking

Built With

O
Objective-C

Included in

iOS51.7k
Auto-fetched 19 hours ago

Related Projects

AlamofireAlamofire

Elegant HTTP Networking in Swift

Stars42,406
Forks7,669
Last commit3 days ago
AFNetworkingAFNetworking

A delightful networking framework for iOS, macOS, watchOS, and tvOS.

Stars33,417
Forks10,604
Last commit3 years ago
MoyaMoya

Network abstraction layer written in Swift.

Stars15,360
Forks1,998
Last commit10 days ago
CocoaAsyncSocketCocoaAsyncSocket

Asynchronous socket networking library for Mac and iOS

Stars12,449
Forks2,990
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub