Define the IP address to redirect to (To block sites use: 127.0.0.1)
Create the file ( loca.conf ) in ${PWD} and add a line like this:
address=/www.playboy.com/127.0.0.1
Save the file.
Next time container's start or dnsmasq service be restarted, the new reocrd will be added.
Tooltip:
You can use the script: addLocal.bash from: github.com/edza978/blockedsites
2. Request service restart and domain' lists updates.
From version 2.0. The user can request an update of the lists and restart of the service from the HOST.
To do this, follow this steps:
Create a file in ${PWD} named: update.now.
touch update.now
The container check for that file every 60 seconds, if it exists the DNS.conf, ads.conf files are downloaded from github.com, the ${PWD}/local.conf file is updated in dnsmasq's config and dnsmasq service is restarted to add the new records.
From version 2.5. The user can define a private/local DNS server to be used as parent if the network administrators blocked external DNS servers.
To do this, follow this steps:
Create a file in ${PWD} named: localDns.conf.
touch update.now
Add the next line to the file changing the 192.168.1.1 to your DNS Server's IP.
server=192.168.1.1 # Local DNS
Next time the service start the local DNS server will be used as unique parent DNS.
Hint:localDns.conf file can be created before docker run so at 1st start dnsmasq will use the private DNS.
4. Create a backup of cache and import it to next executions.
From version 2.5. The user can request a dump of the dnsmasq's cache. This dump will be stored in the file: ${PWD}/cacheDump.txt, and the container's dnsmasq is configured to import that file at start.
To request a dump, follow this steps:
Create a file in ${PWD} named: dump.now.
touch dump.now
The container check for that file every 60 seconds, if it exists the dnsmasq's cache will be dumped to dnsmasq.log and all the IPv4 and IPv6 will be dumped to cacheDump.txt in format similar to /etc/hosts file.
Next time the service start the dnsmasq will import all cacheDump.txt records to it's config.