Skip to content

Commit a75b423

Browse files
committed
doc: Add resolveNaptr and naptr rrtype docs
Updates the dns module documentation to include documentation on the resolveNaptr method, and also adds the option NAPTR to the list of valid values for rrtype in dns.resolve(hostname[, rrtype], callback)
1 parent 9d0b7d8 commit a75b423

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

doc/api/dns.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ Valid values for `rrtype` are:
159159
* `'NS'` - name server records
160160
* `'CNAME'` - canonical name records
161161
* `'SOA'` - start of authority record
162+
* `'NAPTR'` - name authority pointer record
162163

163164
The `callback` function has arguments `(err, addresses)`. When successful,
164165
`addresses` will be an array. The type of each item in `addresses` is
@@ -195,6 +196,33 @@ Uses the DNS protocol to resolve mail exchange records (`MX` records) for the
195196
contain an array of objects containing both a `priority` and `exchange`
196197
property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
197198

199+
## dns.resolveNaptr(hostname, callback)
200+
201+
Uses the DNS protocol to resolve regular expression based records (`NAPTR`
202+
records) for the `hostname`. The `callback` function has arguments
203+
`(err, addresses)`. The `addresses` argument passed to the `callback` function
204+
will contain an array of objects with the following properties:
205+
206+
* `flags`
207+
* `service`
208+
* `regexp`
209+
* `replacement`
210+
* `order`
211+
* `preference`
212+
213+
For example:
214+
215+
```js
216+
{
217+
flags: 's',
218+
service: 'SIP+D2U',
219+
regexp: '',
220+
replacement: '_sip._udp.example.com',
221+
order: 30,
222+
preference: 100
223+
}
224+
```
225+
198226
## dns.resolveNs(hostname, callback)
199227

200228
Uses the DNS protocol to resolve name server records (`NS` records) for the

0 commit comments

Comments
 (0)