Dnsmasq domain overrides import from url or use alias? or command line edit?


  • Hi everybody,

    my setup currently requires about 60 domains to be queried from a specific dns server rather than the default servers… any way to batch import them from a list or do they have to be added one by one... would it be difficult to add the possibility to use alias? or is there a way to edit conveniently via command line without having to mess around with viconfig?

    background:  ISP here censors some domains at a dns level and i have set up an alternative dns server that bypasses isp dns but is too slow to be used for all dns... ideally I could simply maintain one list of censored domains that could be accessible to all routers

    Kind regards,
    Lorenz


  • There is not any quick way to suck all that in on the GUI at present. But you can edit config.xml from the GUI:
    WARNING: Take a backup of the config first - Diagnostics->Backup/Restore

    1. Make a couple of domain override entries from the GUI
    2. Diagnostics->Edit, Load /cf/conf/config.xml
    3. Find the entries you made, make 60 in similar format - make sure not to stuff it up!
    4. Save
    5. Go back to the GUI DNS page, the entries should be listed
    6. Hit Save to force it to reload the running DNS settings
      WARNING AGAIN: when you make typos while doing this it will be your problem to fix it - make sure you have backup and understand what you are doing.

  • you can create a file such as "/root/blockset.conf"

    containing something line:

    address=/discord.com/discord.gg/127.0.0.1
    address=/roblox.com/rbxcdn.com/127.0.0.1
    

    then in the Custom options area for dnsmasq gui

    conf-file=/usr/local/etc/dnsmasq.conf
    conf-file=/root/blockset.conf
    

    If you want them to change on a schedule create a cron script to update or replace the file and reload the service

    see topic cli commands to start and stop services for instructions on how to properly do this...