Dnsmasq is a powerful local DNS service for Linux. Net Control 2 can use dnsmasq for providing Internet restrictions on Linux machines.
Net Control 2 for Linux includes scripts, which can help to install the package in automatic way: just select student computers in the teacher console, use the main menu command N – Options – Client Options; and on the Internet page, enable the Install dnsmasq and restart action and click OK:
After applying the command, you may need to restart the student computers to apply changes. The script will disable the default systemd-resolved service and replace it with dnsmasq service.
After the computer is restarted, please check that the service is installed and active, using the Terminal command:
systemctl status dnsmasq
When the service is installed in automatic way, Net Control 2 will create backup copies of configuration files:
/etc/resolv.conf
/etc/dnsmasq.conf
/etc/NetworkManager/NetworkManager.conf
in the folder /var/lib/nclassroom/backup
Due to the difference between Linux distributions and flavours, the automatic installation may fail in some situations, in this case please install the service manually from Terminal as follows:
- install dnsmasq:
sudo apt install -y dnsmasq
- modify the file /etc/NetworkManager/NetworkManager.conf
in the [main] section, modify or specify:
dns=none
- modify the file /etc/dnsmasq.conf, add the following lines:
- no-resolv
strict-order
domain-needed
bogus-priv
port=53
listen-address=127.0.0.1
server=8.8.8.8
server=8.8.4.4 - in the last lines (server), you need to specify IP addresses of the DNS server in your network or IP addresses of global DNS service providers, like Google
Public DNS 8.8.8.8 и 8.8.4.4
- modify the file /etc/resolv.conf
you need to commend the line nameserver 127.0.0.53:
#nameserver 127.0.0.53
and add the line
nameserver 127.0.0.1
before (!) any other “nameserver” line.
- stop the service systemd-resolved and replace it to dnsmasq:
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved
sudo systemctl enable dnsmasq
sudo systemctl start dnsmasq
- check dnsmasq service status:
sudo systemctl status dnsmasq
- restart the computer to apply changes:
sudo shutdown -r now