Skip to content

Commit 7813af7

Browse files
doug-wadeMyles Borins
authored and
Myles Borins
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). PR-URL: #6586 Fixes: #6507 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 3aef9b8 commit 7813af7

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

doc/api/dns.md

+28
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Valid values for `rrtype` are:
155155
* `'NS'` - name server records
156156
* `'CNAME'` - canonical name records
157157
* `'SOA'` - start of authority record
158+
* `'NAPTR'` - name authority pointer record
158159

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

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

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

0 commit comments

Comments
 (0)