2.7 KiB
hide
| hide | |
|---|---|
|
Server Configuration
Currently, smartdns provides three server modes: UDP, TCP, and DOT.
UDP Server
-
Configure with the
bindparameter. For example:bind 0.0.0.0:53@eth0 bind [::]:53@eth0 bind :53@eth0Options:
- @eth0 indicates that it only provides services on the corresponding NIC.
- [::]:53 indicates that it listens to both IPV6 and IPV4 addresses.
- :53 represents listening to IPV4 addresses.
TCP Server
-
Configure with the
bind-tcpparameter. For example:bind-tcp 0.0.0.0:53@eth0 bind-tcp [::]:53@eth0 bind-tcp :53@eth0 -
Optional, the
tcp-idle-timeparameter controls the TCP idle disconnect time.tcp-idle-time 120
DOT Server
-
Configure with the
bind-tcpparameter. For example:bind-tcp 0.0.0.0:53@eth0 bind-tcp [::]:53@eth0 bind-tcp :53@eth0 -
Set certificate and key files
bind-cert-file smartdns-cert.pem bind-cert-key-file smartdns-key.pem bind-cert-key-pass passOptions:
bind-cert-file: Specifies the certificate file path.bind-cert-key-file: Specifies the certificate key file path.bind-cert-key-pass: Specifies the password for the certificate key file. (Optional)
Note:
If these three parameters are not specified, smartdns will automatically generate a self-signed cert
smartdns-cert.pemandsmartdns-key.pemkey file in the/etc/smartdnsdirectory, with CN as smartdns. -
Optional, the
tcp-idle-timeparameter controls the TCP idle disconnect time.tcp-idle-time 120
Second DNS Server
In addition to supporting basic service, the bind-* parameter also supports more additional features, which can be used as a special second DNS server for specific needs. The corresponding functions that can be enabled are:
-
Configuration example:
bind :53 -no-rule-addr -no-speed-check -no-cache -
Parameter introduction:
Parameter Function -no-rule-addrSkip address rules -no-rule-nameserverSkip Nameserver rules -no-rule-ipsetSkip ipset and nftset rules -no-rule-soaSkip SOA(#) rules -no-dualstack-selectionDisable dual-stack speed test -no-speed-checkDisable speed test -no-cacheStop caching -force-aaaa-soaDisable IPV6 queries