Skip to content

Commit 6d712ac

Browse files
TrottMylesBorins
authored andcommitted
doc,dns: use code markup/markdown in headers
This will allow us to lint for use of `hostname` in prose without flagging `hostname` in code within headers. This also allows us to remove backslash escaping for `[` and `]` inside of header code, which makes the bare markdown more readable. Backport-PR-URL: #31108 PR-URL: #31086 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 805fb8f commit 6d712ac

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

doc/api/dns.md

+37-37
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The `dns` module contains functions belonging to two different categories:
5858
There are subtle consequences in choosing one over the other, please consult
5959
the [Implementation considerations section][] for more information.
6060
61-
## Class: dns.Resolver
61+
## Class: `dns.Resolver`
6262
<!-- YAML
6363
added: v8.3.0
6464
-->
@@ -99,15 +99,15 @@ The following methods from the `dns` module are available:
9999
* [`resolver.reverse()`][`dns.reverse()`]
100100
* [`resolver.setServers()`][`dns.setServers()`]
101101
102-
### resolver.cancel()
102+
### `resolver.cancel()`
103103
<!-- YAML
104104
added: v8.3.0
105105
-->
106106
107107
Cancel all outstanding DNS queries made by this resolver. The corresponding
108108
callbacks will be called with an error with code `ECANCELLED`.
109109
110-
## dns.getServers()
110+
## `dns.getServers()`
111111
<!-- YAML
112112
added: v0.11.3
113113
-->
@@ -128,7 +128,7 @@ section if a custom port is used.
128128
]
129129
```
130130
131-
## dns.lookup(hostname\[, options\], callback)
131+
## `dns.lookup(hostname[, options], callback)`
132132
<!-- YAML
133133
added: v0.1.90
134134
changes:
@@ -218,7 +218,7 @@ configured. Loopback addresses are not considered.
218218
found, then return IPv4 mapped IPv6 addresses. It is not supported
219219
on some operating systems (e.g FreeBSD 10.1).
220220
221-
## dns.lookupService(address, port, callback)
221+
## `dns.lookupService(address, port, callback)`
222222
<!-- YAML
223223
added: v0.11.14
224224
-->
@@ -250,7 +250,7 @@ dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
250250
If this method is invoked as its [`util.promisify()`][]ed version, it returns a
251251
`Promise` for an `Object` with `hostname` and `service` properties.
252252

253-
## dns.resolve(hostname\[, rrtype\], callback)
253+
## `dns.resolve(hostname[, rrtype], callback)`
254254
<!-- YAML
255255
added: v0.1.27
256256
-->
@@ -283,7 +283,7 @@ records. The type and structure of individual results varies based on `rrtype`:
283283
On error, `err` is an [`Error`][] object, where `err.code` is one of the
284284
[DNS error codes](#dns_error_codes).
285285

286-
## dns.resolve4(hostname\[, options\], callback)
286+
## `dns.resolve4(hostname[, options], callback)`
287287
<!-- YAML
288288
added: v0.1.16
289289
changes:
@@ -308,7 +308,7 @@ Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the
308308
will contain an array of IPv4 addresses (e.g.
309309
`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
310310

311-
## dns.resolve6(hostname\[, options\], callback)
311+
## `dns.resolve6(hostname[, options], callback)`
312312
<!-- YAML
313313
added: v0.1.16
314314
changes:
@@ -332,7 +332,7 @@ Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the
332332
`hostname`. The `addresses` argument passed to the `callback` function
333333
will contain an array of IPv6 addresses.
334334

335-
## dns.resolveAny(hostname, callback)
335+
## `dns.resolveAny(hostname, callback)`
336336

337337
* `hostname` {string}
338338
* `callback` {Function}
@@ -381,7 +381,7 @@ DNS server operators may choose not to respond to `ANY`
381381
queries. It may be better to call individual methods like [`dns.resolve4()`][],
382382
[`dns.resolveMx()`][], and so on. For more details, see [RFC 8482][].
383383

384-
## dns.resolveCname(hostname, callback)
384+
## `dns.resolveCname(hostname, callback)`
385385
<!-- YAML
386386
added: v0.3.2
387387
-->
@@ -396,7 +396,7 @@ Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The
396396
will contain an array of canonical name records available for the `hostname`
397397
(e.g. `['bar.example.com']`).
398398

399-
## dns.resolveMx(hostname, callback)
399+
## `dns.resolveMx(hostname, callback)`
400400
<!-- YAML
401401
added: v0.1.27
402402
-->
@@ -411,7 +411,7 @@ Uses the DNS protocol to resolve mail exchange records (`MX` records) for the
411411
contain an array of objects containing both a `priority` and `exchange`
412412
property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
413413

414-
## dns.resolveNaptr(hostname, callback)
414+
## `dns.resolveNaptr(hostname, callback)`
415415
<!-- YAML
416416
added: v0.9.12
417417
-->
@@ -444,7 +444,7 @@ function will contain an array of objects with the following properties:
444444
}
445445
```
446446

447-
## dns.resolveNs(hostname, callback)
447+
## `dns.resolveNs(hostname, callback)`
448448
<!-- YAML
449449
added: v0.1.90
450450
-->
@@ -459,7 +459,7 @@ Uses the DNS protocol to resolve name server records (`NS` records) for the
459459
contain an array of name server records available for `hostname`
460460
(e.g. `['ns1.example.com', 'ns2.example.com']`).
461461

462-
## dns.resolvePtr(hostname, callback)
462+
## `dns.resolvePtr(hostname, callback)`
463463
<!-- YAML
464464
added: v6.0.0
465465
-->
@@ -473,7 +473,7 @@ Uses the DNS protocol to resolve pointer records (`PTR` records) for the
473473
`hostname`. The `addresses` argument passed to the `callback` function will
474474
be an array of strings containing the reply records.
475475

476-
## dns.resolveSoa(hostname, callback)
476+
## `dns.resolveSoa(hostname, callback)`
477477
<!-- YAML
478478
added: v0.11.10
479479
-->
@@ -508,7 +508,7 @@ be an object with the following properties:
508508
}
509509
```
510510

511-
## dns.resolveSrv(hostname, callback)
511+
## `dns.resolveSrv(hostname, callback)`
512512
<!-- YAML
513513
added: v0.1.27
514514
-->
@@ -537,7 +537,7 @@ be an array of objects with the following properties:
537537
}
538538
```
539539

540-
## dns.resolveTxt(hostname, callback)
540+
## `dns.resolveTxt(hostname, callback)`
541541
<!-- YAML
542542
added: v0.1.27
543543
-->
@@ -554,7 +554,7 @@ two-dimensional array of the text records available for `hostname` (e.g.
554554
one record. Depending on the use case, these could be either joined together or
555555
treated separately.
556556

557-
## dns.reverse(ip, callback)
557+
## `dns.reverse(ip, callback)`
558558
<!-- YAML
559559
added: v0.1.16
560560
-->
@@ -570,7 +570,7 @@ array of hostnames.
570570
On error, `err` is an [`Error`][] object, where `err.code` is
571571
one of the [DNS error codes][].
572572

573-
## dns.setServers(servers)
573+
## `dns.setServers(servers)`
574574
<!-- YAML
575575
added: v0.11.3
576576
-->
@@ -612,7 +612,7 @@ The `dns.promises` API provides an alternative set of asynchronous DNS methods
612612
that return `Promise` objects rather than using callbacks. The API is accessible
613613
via `require('dns').promises`.
614614

615-
### Class: dnsPromises.Resolver
615+
### Class: `dnsPromises.Resolver`
616616
<!-- YAML
617617
added: v10.6.0
618618
-->
@@ -658,7 +658,7 @@ The following methods from the `dnsPromises` API are available:
658658
* [`resolver.reverse()`][`dnsPromises.reverse()`]
659659
* [`resolver.setServers()`][`dnsPromises.setServers()`]
660660

661-
### dnsPromises.getServers()
661+
### `dnsPromises.getServers()`
662662
<!-- YAML
663663
added: v10.6.0
664664
-->
@@ -679,7 +679,7 @@ section if a custom port is used.
679679
]
680680
```
681681

682-
### dnsPromises.lookup(hostname\[, options\])
682+
### `dnsPromises.lookup(hostname[, options])`
683683
<!-- YAML
684684
added: v10.6.0
685685
-->
@@ -744,7 +744,7 @@ dnsPromises.lookup('example.com', options).then((result) => {
744744
});
745745
```
746746

747-
### dnsPromises.lookupService(address, port)
747+
### `dnsPromises.lookupService(address, port)`
748748
<!-- YAML
749749
added: v10.6.0
750750
-->
@@ -770,7 +770,7 @@ dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
770770
});
771771
```
772772

773-
### dnsPromises.resolve(hostname\[, rrtype\])
773+
### `dnsPromises.resolve(hostname[, rrtype])`
774774
<!-- YAML
775775
added: v10.6.0
776776
-->
@@ -800,7 +800,7 @@ based on `rrtype`:
800800
On error, the `Promise` is rejected with an [`Error`][] object, where `err.code`
801801
is one of the [DNS error codes](#dns_error_codes).
802802

803-
### dnsPromises.resolve4(hostname\[, options\])
803+
### `dnsPromises.resolve4(hostname[, options])`
804804
<!-- YAML
805805
added: v10.6.0
806806
-->
@@ -816,7 +816,7 @@ Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the
816816
`hostname`. On success, the `Promise` is resolved with an array of IPv4
817817
addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
818818

819-
### dnsPromises.resolve6(hostname\[, options\])
819+
### `dnsPromises.resolve6(hostname[, options])`
820820
<!-- YAML
821821
added: v10.6.0
822822
-->
@@ -832,7 +832,7 @@ Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the
832832
`hostname`. On success, the `Promise` is resolved with an array of IPv6
833833
addresses.
834834

835-
### dnsPromises.resolveAny(hostname)
835+
### `dnsPromises.resolveAny(hostname)`
836836
<!-- YAML
837837
added: v10.6.0
838838
-->
@@ -877,7 +877,7 @@ Here is an example of the result object:
877877
minttl: 60 } ]
878878
```
879879

880-
### dnsPromises.resolveCname(hostname)
880+
### `dnsPromises.resolveCname(hostname)`
881881
<!-- YAML
882882
added: v10.6.0
883883
-->
@@ -888,7 +888,7 @@ Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success,
888888
the `Promise` is resolved with an array of canonical name records available for
889889
the `hostname` (e.g. `['bar.example.com']`).
890890

891-
### dnsPromises.resolveMx(hostname)
891+
### `dnsPromises.resolveMx(hostname)`
892892
<!-- YAML
893893
added: v10.6.0
894894
-->
@@ -900,7 +900,7 @@ Uses the DNS protocol to resolve mail exchange records (`MX` records) for the
900900
containing both a `priority` and `exchange` property (e.g.
901901
`[{priority: 10, exchange: 'mx.example.com'}, ...]`).
902902

903-
### dnsPromises.resolveNaptr(hostname)
903+
### `dnsPromises.resolveNaptr(hostname)`
904904
<!-- YAML
905905
added: v10.6.0
906906
-->
@@ -930,7 +930,7 @@ of objects with the following properties:
930930
}
931931
```
932932

933-
### dnsPromises.resolveNs(hostname)
933+
### `dnsPromises.resolveNs(hostname)`
934934
<!-- YAML
935935
added: v10.6.0
936936
-->
@@ -942,7 +942,7 @@ Uses the DNS protocol to resolve name server records (`NS` records) for the
942942
records available for `hostname` (e.g.
943943
`['ns1.example.com', 'ns2.example.com']`).
944944

945-
### dnsPromises.resolvePtr(hostname)
945+
### `dnsPromises.resolvePtr(hostname)`
946946
<!-- YAML
947947
added: v10.6.0
948948
-->
@@ -953,7 +953,7 @@ Uses the DNS protocol to resolve pointer records (`PTR` records) for the
953953
`hostname`. On success, the `Promise` is resolved with an array of strings
954954
containing the reply records.
955955

956-
### dnsPromises.resolveSoa(hostname)
956+
### `dnsPromises.resolveSoa(hostname)`
957957
<!-- YAML
958958
added: v10.6.0
959959
-->
@@ -985,7 +985,7 @@ following properties:
985985
}
986986
```
987987

988-
### dnsPromises.resolveSrv(hostname)
988+
### `dnsPromises.resolveSrv(hostname)`
989989
<!-- YAML
990990
added: v10.6.0
991991
-->
@@ -1011,7 +1011,7 @@ the following properties:
10111011
}
10121012
```
10131013

1014-
### dnsPromises.resolveTxt(hostname)
1014+
### `dnsPromises.resolveTxt(hostname)`
10151015
<!-- YAML
10161016
added: v10.6.0
10171017
-->
@@ -1025,7 +1025,7 @@ of the text records available for `hostname` (e.g.
10251025
one record. Depending on the use case, these could be either joined together or
10261026
treated separately.
10271027

1028-
### dnsPromises.reverse(ip)
1028+
### `dnsPromises.reverse(ip)`
10291029
<!-- YAML
10301030
added: v10.6.0
10311031
-->
@@ -1038,7 +1038,7 @@ array of hostnames.
10381038
On error, the `Promise` is rejected with an [`Error`][] object, where `err.code`
10391039
is one of the [DNS error codes](#dns_error_codes).
10401040

1041-
### dnsPromises.setServers(servers)
1041+
### `dnsPromises.setServers(servers)`
10421042
<!-- YAML
10431043
added: v10.6.0
10441044
-->

0 commit comments

Comments
 (0)