Swift implementation of DNS Records / RR
Swift
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Sources/DNS
Tests
.gitignore
.jazzy.yaml
.swiftlint.yml
.travis.yml
LICENSE
Package.swift
README.md

README.md

DNS Record Types

A Swift implementation of DNS Record Types. Used for example in mDNS / NetService.

Build Status

Usage

// Encoding a message
let request = Message(
    type: .query,
    questions: [Question(name: "apple.com.", type: .pointer)]
)
let requestData = try request.serialize()

// Not shown here: send to DNS server over UDP, receive reply.

// Decoding a message
let responseData = Data()
let response = try Message.init(deserialize: responseData)
print(response.answers.first)

Credits

This library was written by Bouke Haarsma.