Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changelog and documentation updates #135

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v0.10.0 - unreleased

- Add support for discovering hosts using DNS `SRV` records. #133 #131
- Add support for reading DNS configuration from system `/etc/resolv.conf`
files. #134
- Use a shorter TTL for entries written via `mc bench`. #130

## v0.9.0 - 2024-02-12

- Change host selection in `mtop` to allow more host tabs than fit on the
Expand Down
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ mtop cache01.example.com:11211 cache02.example.com:11211 cache03.example.com:112

### Connecting to multiple servers with a single DNS name

In this example, a DNS lookup for `memcached.local` returns three DNS `A` records.
#### A or AAAA

In this example, a DNS `A` lookup for `memcached.local` returns three DNS `A` records.

```
dig memcached.local
dig -t A memcached.local
;; QUESTION SECTION:
;memcached.local. IN A

Expand All @@ -129,10 +131,36 @@ memcached.local. 0 IN A 127.0.0.2
memcached.local. 0 IN A 127.0.0.1
```

`mtop` will connect to all three servers: `127.0.0.1`, `127.0.0.2`, and `127.0.0.3`.

```
mtop dns+memcached.local:11211
```

#### SRV

In this example, a DNS `SRV` lookup for `_memcached._tcp.example.com` returns three DNS `SRV` records.

```
dig -t SRV _memcached._tcp.example.com
;; QUESTION SECTION:
;_memcached._tcp.example.com. IN SRV

;; ANSWER SECTION:
_memcached._tcp.example.com. 300 IN SRV 100 100 11211 memcached01.example.com.
_memcached._tcp.example.com. 300 IN SRV 100 100 11211 memcached02.example.com.
_memcached._tcp.example.com. 300 IN SRV 100 100 11211 memcached03.example.com.
```

`mtop` will connect to all three servers, resolving their names to `A` or `AAAA` records
when connections are established: `memcached01.example.com.`, `memcached02.example.com.`,
and `memcached03.example.com.`. Note that the port number from the `SRV` records are ignored,
only the port from the command line argument is used.

```
mtop dnssrv+_memcached._tcp.example.com:11211
```

### Connecting to a port-forwarded Kubernetes pod

```
Expand Down
2 changes: 1 addition & 1 deletion mtop-client/src/dns/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ pub use crate::dns::rdata::{
RecordData, RecordDataA, RecordDataAAAA, RecordDataCNAME, RecordDataNS, RecordDataSOA, RecordDataSRV,
RecordDataTXT, RecordDataUnknown,
};
pub use resolv::{config, ResolvConf, ResolvConfOptions};
pub use crate::dns::resolv::{config, ResolvConf, ResolvConfOptions};