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