Skip to content

Commit

Permalink
Merge pull request #135 from 56quarters/cleanup
Browse files Browse the repository at this point in the history
Changelog and documentation updates
  • Loading branch information
56quarters authored May 17, 2024
2 parents 459328e + caf4cfc commit d5c88bf
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
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};

0 comments on commit d5c88bf

Please sign in to comment.