Skip to content

Commit a1b095d

Browse files
TrottBethGriggs
authored andcommittedDec 31, 2019
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: #31109 PR-URL: #31086 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 25b8fbd commit a1b095d

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
@@ -56,7 +56,7 @@ dns.resolve4('archive.org', (err, addresses) => {
5656
There are subtle consequences in choosing one over the other, please consult
5757
the [Implementation considerations section][] for more information.
5858

59-
## Class: dns.Resolver
59+
## Class: `dns.Resolver`
6060
<!-- YAML
6161
added: v8.3.0
6262
-->
@@ -97,15 +97,15 @@ The following methods from the `dns` module are available:
9797
* [`resolver.reverse()`][`dns.reverse()`]
9898
* [`resolver.setServers()`][`dns.setServers()`]
9999

100-
### resolver.cancel()
100+
### `resolver.cancel()`
101101
<!-- YAML
102102
added: v8.3.0
103103
-->
104104

105105
Cancel all outstanding DNS queries made by this resolver. The corresponding
106106
callbacks will be called with an error with code `ECANCELLED`.
107107

108-
## dns.getServers()
108+
## `dns.getServers()`
109109
<!-- YAML
110110
added: v0.11.3
111111
-->
@@ -126,7 +126,7 @@ section if a custom port is used.
126126
]
127127
```
128128

129-
## dns.lookup(hostname[, options], callback)
129+
## `dns.lookup(hostname[, options], callback)`
130130
<!-- YAML
131131
added: v0.1.90
132132
changes:
@@ -212,7 +212,7 @@ configured. Loopback addresses are not considered.
212212
found, then return IPv4 mapped IPv6 addresses. Note that it is not supported
213213
on some operating systems (e.g FreeBSD 10.1).
214214

215-
## dns.lookupService(address, port, callback)
215+
## `dns.lookupService(address, port, callback)`
216216
<!-- YAML
217217
added: v0.11.14
218218
-->
@@ -243,7 +243,7 @@ dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
243243
If this method is invoked as its [`util.promisify()`][]ed version, it returns a
244244
`Promise` for an `Object` with `hostname` and `service` properties.
245245

246-
## dns.resolve(hostname[, rrtype], callback)
246+
## `dns.resolve(hostname[, rrtype], callback)`
247247
<!-- YAML
248248
added: v0.1.27
249249
-->
@@ -275,7 +275,7 @@ records. The type and structure of individual results varies based on `rrtype`:
275275
On error, `err` is an [`Error`][] object, where `err.code` is one of the
276276
[DNS error codes](#dns_error_codes).
277277

278-
## dns.resolve4(hostname[, options], callback)
278+
## `dns.resolve4(hostname[, options], callback)`
279279
<!-- YAML
280280
added: v0.1.16
281281
changes:
@@ -299,7 +299,7 @@ Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the
299299
will contain an array of IPv4 addresses (e.g.
300300
`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
301301

302-
## dns.resolve6(hostname[, options], callback)
302+
## `dns.resolve6(hostname[, options], callback)`
303303
<!-- YAML
304304
added: v0.1.16
305305
changes:
@@ -322,7 +322,7 @@ Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the
322322
`hostname`. The `addresses` argument passed to the `callback` function
323323
will contain an array of IPv6 addresses.
324324

325-
## dns.resolveAny(hostname, callback)
325+
## `dns.resolveAny(hostname, callback)`
326326

327327
* `hostname` {string}
328328
* `callback` {Function}
@@ -371,7 +371,7 @@ DNS server operators may choose not to respond to `ANY`
371371
queries. It may be better to call individual methods like [`dns.resolve4()`][],
372372
[`dns.resolveMx()`][], and so on. For more details, see [RFC 8482][].
373373

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

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

402-
## dns.resolveNaptr(hostname, callback)
402+
## `dns.resolveNaptr(hostname, callback)`
403403
<!-- YAML
404404
added: v0.9.12
405405
-->
@@ -431,7 +431,7 @@ function will contain an array of objects with the following properties:
431431
}
432432
```
433433

434-
## dns.resolveNs(hostname, callback)
434+
## `dns.resolveNs(hostname, callback)`
435435
<!-- YAML
436436
added: v0.1.90
437437
-->
@@ -445,7 +445,7 @@ Uses the DNS protocol to resolve name server records (`NS` records) for the
445445
contain an array of name server records available for `hostname`
446446
(e.g. `['ns1.example.com', 'ns2.example.com']`).
447447

448-
## dns.resolvePtr(hostname, callback)
448+
## `dns.resolvePtr(hostname, callback)`
449449
<!-- YAML
450450
added: v6.0.0
451451
-->
@@ -458,7 +458,7 @@ Uses the DNS protocol to resolve pointer records (`PTR` records) for the
458458
`hostname`. The `addresses` argument passed to the `callback` function will
459459
be an array of strings containing the reply records.
460460

461-
## dns.resolveSoa(hostname, callback)
461+
## `dns.resolveSoa(hostname, callback)`
462462
<!-- YAML
463463
added: v0.11.10
464464
-->
@@ -492,7 +492,7 @@ be an object with the following properties:
492492
}
493493
```
494494

495-
## dns.resolveSrv(hostname, callback)
495+
## `dns.resolveSrv(hostname, callback)`
496496
<!-- YAML
497497
added: v0.1.27
498498
-->
@@ -520,7 +520,7 @@ be an array of objects with the following properties:
520520
}
521521
```
522522

523-
## dns.resolveTxt(hostname, callback)
523+
## `dns.resolveTxt(hostname, callback)`
524524
<!-- YAML
525525
added: v0.1.27
526526
-->
@@ -536,7 +536,7 @@ two-dimensional array of the text records available for `hostname` (e.g.
536536
one record. Depending on the use case, these could be either joined together or
537537
treated separately.
538538

539-
## dns.reverse(ip, callback)
539+
## `dns.reverse(ip, callback)`
540540
<!-- YAML
541541
added: v0.1.16
542542
-->
@@ -551,7 +551,7 @@ array of hostnames.
551551
On error, `err` is an [`Error`][] object, where `err.code` is
552552
one of the [DNS error codes][].
553553

554-
## dns.setServers(servers)
554+
## `dns.setServers(servers)`
555555
<!-- YAML
556556
added: v0.11.3
557557
-->
@@ -594,7 +594,7 @@ The `dns.promises` API provides an alternative set of asynchronous DNS methods
594594
that return `Promise` objects rather than using callbacks. The API is accessible
595595
via `require('dns').promises`.
596596

597-
### Class: dnsPromises.Resolver
597+
### Class: `dnsPromises.Resolver`
598598
<!-- YAML
599599
added: v10.6.0
600600
-->
@@ -640,7 +640,7 @@ The following methods from the `dnsPromises` API are available:
640640
* [`resolver.reverse()`][`dnsPromises.reverse()`]
641641
* [`resolver.setServers()`][`dnsPromises.setServers()`]
642642

643-
### dnsPromises.getServers()
643+
### `dnsPromises.getServers()`
644644
<!-- YAML
645645
added: v10.6.0
646646
-->
@@ -661,7 +661,7 @@ section if a custom port is used.
661661
]
662662
```
663663

664-
### dnsPromises.lookup(hostname[, options])
664+
### `dnsPromises.lookup(hostname[, options])`
665665
<!-- YAML
666666
added: v10.6.0
667667
-->
@@ -724,7 +724,7 @@ dnsPromises.lookup('example.com', options).then((result) => {
724724
});
725725
```
726726

727-
### dnsPromises.lookupService(address, port)
727+
### `dnsPromises.lookupService(address, port)`
728728
<!-- YAML
729729
added: v10.6.0
730730
-->
@@ -749,7 +749,7 @@ dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
749749
});
750750
```
751751

752-
### dnsPromises.resolve(hostname[, rrtype])
752+
### `dnsPromises.resolve(hostname[, rrtype])`
753753
<!-- YAML
754754
added: v10.6.0
755755
-->
@@ -778,7 +778,7 @@ based on `rrtype`:
778778
On error, the `Promise` is rejected with an [`Error`][] object, where `err.code`
779779
is one of the [DNS error codes](#dns_error_codes).
780780

781-
### dnsPromises.resolve4(hostname[, options])
781+
### `dnsPromises.resolve4(hostname[, options])`
782782
<!-- YAML
783783
added: v10.6.0
784784
-->
@@ -793,7 +793,7 @@ Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the
793793
`hostname`. On success, the `Promise` is resolved with an array of IPv4
794794
addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
795795

796-
### dnsPromises.resolve6(hostname[, options])
796+
### `dnsPromises.resolve6(hostname[, options])`
797797
<!-- YAML
798798
added: v10.6.0
799799
-->
@@ -808,7 +808,7 @@ Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the
808808
`hostname`. On success, the `Promise` is resolved with an array of IPv6
809809
addresses.
810810

811-
### dnsPromises.resolveAny(hostname)
811+
### `dnsPromises.resolveAny(hostname)`
812812
<!-- YAML
813813
added: v10.6.0
814814
-->
@@ -852,7 +852,7 @@ Here is an example of the result object:
852852
minttl: 60 } ]
853853
```
854854

855-
### dnsPromises.resolveCname(hostname)
855+
### `dnsPromises.resolveCname(hostname)`
856856
<!-- YAML
857857
added: v10.6.0
858858
-->
@@ -862,7 +862,7 @@ Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success,
862862
the `Promise` is resolved with an array of canonical name records available for
863863
the `hostname` (e.g. `['bar.example.com']`).
864864

865-
### dnsPromises.resolveMx(hostname)
865+
### `dnsPromises.resolveMx(hostname)`
866866
<!-- YAML
867867
added: v10.6.0
868868
-->
@@ -873,7 +873,7 @@ Uses the DNS protocol to resolve mail exchange records (`MX` records) for the
873873
containing both a `priority` and `exchange` property (e.g.
874874
`[{priority: 10, exchange: 'mx.example.com'}, ...]`).
875875

876-
### dnsPromises.resolveNaptr(hostname)
876+
### `dnsPromises.resolveNaptr(hostname)`
877877
<!-- YAML
878878
added: v10.6.0
879879
-->
@@ -902,7 +902,7 @@ of objects with the following properties:
902902
}
903903
```
904904

905-
### dnsPromises.resolveNs(hostname)
905+
### `dnsPromises.resolveNs(hostname)`
906906
<!-- YAML
907907
added: v10.6.0
908908
-->
@@ -913,7 +913,7 @@ Uses the DNS protocol to resolve name server records (`NS` records) for the
913913
records available for `hostname` (e.g.
914914
`['ns1.example.com', 'ns2.example.com']`).
915915

916-
### dnsPromises.resolvePtr(hostname)
916+
### `dnsPromises.resolvePtr(hostname)`
917917
<!-- YAML
918918
added: v10.6.0
919919
-->
@@ -923,7 +923,7 @@ Uses the DNS protocol to resolve pointer records (`PTR` records) for the
923923
`hostname`. On success, the `Promise` is resolved with an array of strings
924924
containing the reply records.
925925

926-
### dnsPromises.resolveSoa(hostname)
926+
### `dnsPromises.resolveSoa(hostname)`
927927
<!-- YAML
928928
added: v10.6.0
929929
-->
@@ -954,7 +954,7 @@ following properties:
954954
}
955955
```
956956

957-
### dnsPromises.resolveSrv(hostname)
957+
### `dnsPromises.resolveSrv(hostname)`
958958
<!-- YAML
959959
added: v10.6.0
960960
-->
@@ -979,7 +979,7 @@ the following properties:
979979
}
980980
```
981981

982-
### dnsPromises.resolveTxt(hostname)
982+
### `dnsPromises.resolveTxt(hostname)`
983983
<!-- YAML
984984
added: v10.6.0
985985
-->
@@ -992,7 +992,7 @@ of the text records available for `hostname` (e.g.
992992
one record. Depending on the use case, these could be either joined together or
993993
treated separately.
994994

995-
### dnsPromises.reverse(ip)
995+
### `dnsPromises.reverse(ip)`
996996
<!-- YAML
997997
added: v10.6.0
998998
-->
@@ -1004,7 +1004,7 @@ array of hostnames.
10041004
On error, the `Promise` is rejected with an [`Error`][] object, where `err.code`
10051005
is one of the [DNS error codes](#dns_error_codes).
10061006

1007-
### dnsPromises.setServers(servers)
1007+
### `dnsPromises.setServers(servers)`
10081008
<!-- YAML
10091009
added: v10.6.0
10101010
-->

0 commit comments

Comments
 (0)
Please sign in to comment.