User Tools

Site Tools


QNAP DNS Server Instructions C. Slappey


1. Install Optware ipkg from list of apps in QNAP->Administration->Application Servers->QPKG Center
2. Enable SSH server
3. Install putty and connect
4. Check ipkg installation by typing ipkg --version
5. Update pkgmgr and install packages. See
ipkg update
/opt/bin/ipkg install dnsmasq
ipkg install nano
6. Copy the hosts file to a place where it won’t be overwritten at boot. See
mkdir /etc/config/user
cp /etc/hosts /etc/config/user/dnsmasq-hosts.conf
7. Copy the resolv file to a place where it won’t be overwritten at boot
cp /etc/resolv.conf /etc/config/user/dnsmasq-resolv.conf
8. Edit hosts file to contain your ip/ name resolutions
nano /etc/config/user/dnsmasq-hosts.conf    localhost    localhost
    ipaddress0    QNAPServer
    ipaddress1    name1
    ipaddress2    name2
Ctrl+o - Save as
Enter - Select
Ctrl+x - Exit
9. Edit resolv file. See
(As of today I will be using and Google Domain Name Servers)
nano /etc/config/user/dnsmasq-resolv.conf
    nameserver X.X.X.X (IP of normal DNS entry 1)
    nameserver Y.Y.Y.Y (IP of normal DNS entry 2)
    search Aydindril (where Aydindril is your workgroup)
Ctrl+o - Save as
Enter - Select
Ctrl+x - Exit
10. Edit dnsmasq.conf file. See (If not using Qnap, but other linux machine, could be in /etc/dnsmasq.conf instead)
nano /opt/etc/dnsmasq.conf
    no-hosts #don’t use /etc/hosts because it is overwritten at boot
    addn-hosts=/etc/config/user/dnsmasq-hosts.conf #Read custom hosts
    resolv-file=/etc/config/user/dnsmasq-resolv.conf #Override resolv.conf
11. Run the service. (/etc/init.d/dnsmasq start on other linux machines)
/opt/etc/init.d/S56dnsmasq start

TESTING From a computer change the dns settings to manually assign rather than automatic. Test that you can go to your custom hosts from a browser or other means. Test that you can still reach unspecified hosts (try your favorite website or something). If it works then

general/qnap_dnsmasq.txt · Last modified: 2020/11/17 18:17 by sunkan

Donate Powered by PHP Valid HTML5 Valid CSS Run on Debian Driven by DokuWiki