https://github.com/bouke/dns
Swift implementation of DNS Records / RR
https://github.com/bouke/dns
dns dns-record rfc-1035
Last synced: 2 months 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 (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-24T05:37:56.000Z (11 months ago)
- Last Synced: 2025-04-11T04:02:36.078Z (2 months ago)
- Topics: dns, dns-record, rfc-1035
- Language: Swift
- Homepage: http://boukehaarsma.nl/DNS
- Size: 296 KB
- Stars: 66
- Watchers: 6
- Forks: 22
- 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.[](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).