• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dnsimple / dns_erlang / 21432310233
85%

Build:
DEFAULT BRANCH: main
Ran 28 Jan 2026 09:19AM UTC
Jobs 1
Files 13
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Jan 2026 09:18AM UTC coverage: 85.422% (+0.6%) from 84.852%
21432310233

push

github

web-flow
Consolidate domain name operations into `dns_domain` module — much better perf and RFC compliance (#106)

This PR consolidates all domain name processing functions into a new optimized `dns_domain` module,
removing wrapper functions from `dns`, `dns_encode`, and `dns_decode` modules. This improves code
organization, performance, and RFC compliance.

TL;DR: checkout this branch, do `rebar3 ex_doc`, and see documentation for the `dns_domain` module.

---

### Summary

- **Consolidated** all domain name operations into `dns_domain` module
- **Removed** wrapper functions from `dns`, `dns_encode`, and `dns_decode`
- **Renamed** comparison functions for clarity (`compare_dname` → `are_equal`, `compare_labels` → `are_equal_labels`)
- **Enhanced** `join/1` with `join/2` to support FQDN formatting (trailing dot)
- **Improved** error handling consistency (changed `throw/1` to `error/1` in several places)
- **Refactored** tests to use consistent `{Input, Expected}` pattern
- **Enhanced** [RFC1035](https://datatracker.ietf.org/doc/html/rfc1035) and [RFC9267](https://datatracker.ietf.org/doc/html/rfc9267) compliance with accurate wire format size tracking

### Breaking Changes

All domain name utility functions have been moved from `dns` module to `dns_domain`. The following
functions have been **removed**:

- `dns:dname_to_labels/1`
- `dns:labels_to_dname/1`
- `dns:dname_to_lower_labels/1`
- `dns:dname_to_upper/1`
- `dns:dname_to_lower/1`
- `dns:compare_dname/2`
- `dns:compare_labels/2`
- `dns:escape_label/1`
- `dns_encode:encode_dname/1`
- `dns_decode:decode_dname/2`

**New Feature:** `dns_domain:join/2` now supports FQDN formatting:

### Performance Improvements

Benchmarking results show significant performance improvements across all domain name operations:

**`from_wire/2` (decoding):**
- **2.18x faster** for maximum name length (127 single-byte labels)
- **1.99x faster** for long domain names (5-10 labels)
- **1.78x faster** for maximum label length (63 byt... (continued)

256 of 277 new or added lines in 7 files covered. (92.42%)

51 existing lines in 3 files now uncovered.

3252 of 3807 relevant lines covered (85.42%)

10661.73 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
92.72
0.59% src/dns_decode.erl
2
89.53
0.0% src/dns_zone_encode.erl
3
98.04
src/dns_domain.erl
4
80.23
0.39% src/dns_encode.erl
4
68.0
0.0% src/dns_tsig.erl
7
72.99
0.0% src/dnssec.erl

Uncovered Existing Lines

Lines Coverage ∆ File
6
88.0
-1.92% src/dns.erl
16
92.72
0.59% src/dns_decode.erl
29
80.23
0.39% src/dns_encode.erl
Jobs
ID Job ID Ran Files Coverage
1 21432310233.1 28 Jan 2026 09:19AM UTC 13
85.42
GitHub Action Run
Source Files on build 21432310233
  • Tree
  • List 13
  • Changed 8
  • Source Changed 8
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #21432310233
  • c2be7e20 on github
  • Prev Build on main (#21399197388)
  • Next Build on main (#21441376739)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc