Skip to content

Standard Linux system installation/Raspberry Pi, X86_64 system


Download the installation package like smartdns.xxxxxxxx.arm-debian-all.deb and upload it to the Linux system. Run the following command to install

dpkg -i smartdns.xxxxxxxx.arm-debian-all.deb

For X86-64 system, download the installation package like smartdns.xxxxxxxx.x86_64-linux-all.tar.gz and upload it to the Linux system. Run the following command to install

tar zxf smartdns.xxxxxxxx.x86_64-linux-all.tar.gz
cd smartdns
chmod +x ./install
./install -i

For Ubuntu system:

  • systemd-resolved occupies TCP53 and UDP53 ports. You need to manually resolve the port occupancy problem or modify the SmartDNS listening port

  • Log files in /var/log/smartdns/smartdns.log


After the installation is complete, you can configure the upstream server to smartdns. Refer to the Configuration Parameters for specific configuration parameters.
In general, you only need to add server [IP]:port, server-tcp [IP]:port configuration items.
Configure as many upstream DNS servers as possible, including servers at home and abroad. Please refer to the Configuration Parameters section for configuration parameters.

vi /etc/smartdns/smartdns.conf

smartdns.conf example:

# set listen port
bind []:53 
# set upstream servers
# set domain rules
address /
domain-rules / -address

Start Service

systemctl enable smartdns
systemctl start smartdns

Forwarding DNS request to SmartDNS

Modify the DNS server of the local router and configure the DNS server as SmartDNS.

  • Log in to the router on the local network and configure the Raspberry Pi to assign a static IP address.
  • Modify the WAN port or DHCP DNS to the Raspberry Pi IP address.

Note: I. Each router configuration method is different. Please search Baidu for related configuration methods. II. some routers may not support configuring custom DNS server. in this case, please modify the PC's, mobile phone's DNS server to the ip of Raspberry Pi.

Check if the service is configured successfully

Query domain name with nslookup -querytype=ptr smartdns
Check if the name item in the command result is displayed as smartdns or hostname, such as smartdns

pi@raspberrypi:~/code/smartdns_build $ nslookup -querytype=ptr smartdns

Non-authoritative answer:
smartdns         name = smartdns.