DNSServer
open class DNSServer: DNSResolverDelegate, IPStackProtocol
A DNS server designed as an IPStackProtocol
implementation which works with TUN interface.
This class is thread-safe.
-
Current DNS server.
Warning
There is at most one DNS server running at the same time. If a DNS server is registered toTUNInterface
then it must also be set here.Declaration
Swift
open static var currentServer: DNSServer?
-
The address of DNS server.
Declaration
Swift
let serverAddress: IPAddress
-
The port of DNS server
Declaration
Swift
let serverPort: Port
-
Declaration
Swift
open var outputFunc: (([Data], [NSNumber]) -> Void)!
-
Input IP packet into the DNS server.
Declaration
Swift
open func input(packet: Data, version: NSNumber?) -> Bool
Parameters
packet
The IP packet.
version
The version of the IP packet.
Return Value
If the packet is taken in by this DNS server.
-
Undocumented
Declaration
Swift
open class DNSServer: DNSResolverDelegate, IPStackProtocol
-
Declaration
Swift
open func stop()
-
Undocumented
Declaration
Swift
open class DNSServer: DNSResolverDelegate, IPStackProtocol
-
Undocumented
Declaration
Swift
open class DNSServer: DNSResolverDelegate, IPStackProtocol
-
Add new DNS resolver to DNS server.
Declaration
Swift
open func registerResolver(_ resolver: DNSResolverProtocol)
Parameters
resolver
The resolver to add.
-
Undocumented
Declaration
Swift
open class DNSServer: DNSResolverDelegate, IPStackProtocol