Package io.netty.resolver.dns
Class ResolvConf
java.lang.Object
io.netty.resolver.dns.ResolvConf
Looks up the
nameserver
s from the /etc/resolv.conf
file, intended for Linux and macOS.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static ResolvConf
Reads the given file and extracts thenameserver
s using the syntax of the/etc/resolv.conf
file, seeman resolv.conf
.(package private) static ResolvConf
fromReader
(BufferedReader reader) Reads from the given reader and extracts thenameserver
s using the syntax of the/etc/resolv.conf
file, seeman resolv.conf
.(package private) List
<InetSocketAddress> (package private) static ResolvConf
system()
Returns thenameserver
s from the/etc/resolv.conf
file.
-
Field Details
-
nameservers
-
-
Constructor Details
-
ResolvConf
- Throws:
IOException
-
-
Method Details
-
fromReader
Reads from the given reader and extracts thenameserver
s using the syntax of the/etc/resolv.conf
file, seeman resolv.conf
.- Parameters:
reader
- contents ofresolv.conf
are read from thisBufferedReader
, up to the caller to close it- Throws:
IOException
-
fromFile
Reads the given file and extracts thenameserver
s using the syntax of the/etc/resolv.conf
file, seeman resolv.conf
.- Throws:
IOException
-
system
Returns thenameserver
s from the/etc/resolv.conf
file. The file is only read once during the lifetime of this class. -
getNameservers
List<InetSocketAddress> getNameservers()
-