Package io.netty.resolver.dns
Class ResolvConf
- java.lang.Object
-
- io.netty.resolver.dns.ResolvConf
-
final class ResolvConf extends java.lang.Object
Looks up thenameserver
s from the/etc/resolv.conf
file, intended for Linux and macOS.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ResolvConf.ResolvConfLazy
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.net.InetSocketAddress>
nameservers
-
Constructor Summary
Constructors Modifier Constructor Description private
ResolvConf(java.io.BufferedReader reader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static ResolvConf
fromFile(java.lang.String file)
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(java.io.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) java.util.List<java.net.InetSocketAddress>
getNameservers()
(package private) static ResolvConf
system()
Returns thenameserver
s from the/etc/resolv.conf
file.
-
-
-
Method Detail
-
fromReader
static ResolvConf fromReader(java.io.BufferedReader reader) throws java.io.IOException
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:
java.io.IOException
-
fromFile
static ResolvConf fromFile(java.lang.String file) throws java.io.IOException
Reads the given file and extracts thenameserver
s using the syntax of the/etc/resolv.conf
file, seeman resolv.conf
.- Throws:
java.io.IOException
-
system
static ResolvConf system()
Returns thenameserver
s from the/etc/resolv.conf
file. The file is only read once during the lifetime of this class.
-
getNameservers
java.util.List<java.net.InetSocketAddress> getNameservers()
-
-