resolv
DNS resolution nimble making use of the native glibc resolv library
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:24 |
Tags
Installation
nimble install resolv
choosenim install resolv
git clone https://github.com/mildred/resolv.nim
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| resolv | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/mildred/resolv.nim |
|---|---|
| Homepage | https://github.com/mildred/resolv.nim |
| Registry Source | nimble_official |
README
resolv.nim
Nim bindings for the glibc resolution library -lresolv. it allows to resolve
DNS queries using the system resolver. You don't have to use well-known DNS
resolvers hardcoded or parse configuration files yourself.
Warning: this library is probably not thread safe due to the fact that the glibc library itself is not thread safe. Use it only in your main thread.
Example
import resolv
let rmsg = query("gmail.com", QType.MX)
if rmsg.header.flags.rcode == RCode.NoError:
for ans in rmsg.answers:
if ans.type != Type.MX: continue
echo RDataMX(ans.rdata).preference
echo RDataMX(ans.rdata).exchange