Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcombeau/dns-tools
https://github.com/mcombeau/dns-tools
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mcombeau/dns-tools
- Owner: mcombeau
- Created: 2024-07-13T07:50:53.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-30T13:48:04.000Z (4 months ago)
- Last Synced: 2024-09-08T14:25:43.468Z (4 months ago)
- Language: Go
- Size: 1.89 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dns-tools
A small DNS message toolkit in Go, which is mostly RFC 1035 compliant. It includes encoding and decoding functions and is able to handle compressed DNS messages.
It also includes a client which is able to encode and send a DNS question and print the answer in a human-readable dig-like format.
## Usage
To run tests:
```shell
go test ./... -v
```### DNS Client
To run the DNS client:
```shell
go run ./cmd/client/client.go [-s server] [-p port] [-x] [question_type]
```Options:
- `-h`: show help
- `-s`: specify the DNS resolver server IP to query (defaults to local resolver)
- `-p`: specify the DNS resolver server port to query (defaults to 53)
- `-x`: enable reverse DNS query (default: false)### DNS Server
To run the DNS server:
```shell
go run ./cmd/server/server.go
```The server runs on `127.0.0.1:5553`.
To test the server with `dig`:
```shell
dig @127.0.0.1 -p 5553 example.com A
```To test the server with the included client:
```shell
go run ./cmd/client/client.go -s 127.0.0.1 -p 5553 example.com A
```---
Made by mcombeau | LinkedIn: [mcombeau](https://www.linkedin.com/in/mia-combeau-86653420b/) | Website: [codequoi.com](https://www.codequoi.com)