Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Mar 13, 2024
1 parent dd983d1 commit 33deadc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { dns } from '@multiformats/dns'

const resolver = dns()

// resolve A and AAAA records with a 5s timeout
// resolve A records with a 5s timeout
const result = await dns.query('google.com', {
signal: AbortSignal.timeout(5000)
})
Expand Down Expand Up @@ -70,14 +70,18 @@ import { dns, RecordType } from '@multiformats/dns'

const resolver = dns()

// resolve only TXT records
// resolve TXT records
const result = await dns.query('google.com', {
types: [
RecordType.TXT
]
})
```

N.b if multiple record types are specified, most resolvers will throw if answers
are not available for all of them, so if you consider some record types optional
it's better to make multiple queries.

## Caching

Individual Aanswers are cached so. If you make a request, for which all
Expand Down

0 comments on commit 33deadc

Please sign in to comment.