Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bouke/dns
Swift implementation of DNS Records / RR
https://github.com/bouke/dns
dns dns-record rfc-1035
Last synced: 17 days ago
JSON representation
Swift implementation of DNS Records / RR
- Host: GitHub
- URL: https://github.com/bouke/dns
- Owner: Bouke
- License: mit
- Created: 2017-03-29T07:54:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-24T05:37:56.000Z (4 months ago)
- Last Synced: 2024-10-12T07:28:49.133Z (about 1 month ago)
- Topics: dns, dns-record, rfc-1035
- Language: Swift
- Homepage: http://boukehaarsma.nl/DNS
- Size: 296 KB
- Stars: 64
- Watchers: 7
- Forks: 23
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
DNS Record Types
================A Swift implementation of DNS Record Types. Used for example in mDNS /
NetService.[![Build Status](https://travis-ci.org/Bouke/DNS.svg?branch=master)](https://travis-ci.org/Bouke/DNS)
## Usage
```swift
// 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](https://twitter.com/BoukeHaarsma).