resolv
Access glibc DNS resolution routines
Summary
| Latest Version | 0.1.0 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-09-01 07:18 |
Tags
Authors
- Mildred Ki'Lya
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 | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 1.4.8 | No |
| dnsprotocol | - | No |
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