Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
17.7 Legacy Series
»
/var/etc/dnsmasq-hosts is overwritten on dnsmasq restart
« previous
next »
Print
Pages: [
1
]
Author
Topic: /var/etc/dnsmasq-hosts is overwritten on dnsmasq restart (Read 7058 times)
ziel
Newbie
Posts: 7
Karma: 2
/var/etc/dnsmasq-hosts is overwritten on dnsmasq restart
«
on:
November 23, 2017, 05:01:46 pm »
OpnSense Version 17.7.8
Steps to reproduce:
1) ssh
2) su
3) Edit /var/etc/dnsmasq-hosts
4) write file
5) restart dnsmasq in web-GUI
Results:
- in dnsmasq-log "/var/etc/dnsmasq-hosts 0 addresses
Expected results:
- dnsmasq loads addresses from /var/etc/dnsmasq-hosts
Is there a bug or do I have wrong expectations?
Logged
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: /var/etc/dnsmasq-hosts is overwritten on dnsmasq restart
«
Reply #1 on:
November 23, 2017, 05:26:40 pm »
Quote from: ziel on November 23, 2017, 05:01:46 pm
Is there a bug or do I have wrong expectations?
Probably the latter, as OPNsense ensures that the content of the configuration files matches the settings you add via the GUI (files are written at many times).
Logged
weust
Hero Member
Posts: 650
Karma: 57
Re: /var/etc/dnsmasq-hosts is overwritten on dnsmasq restart
«
Reply #2 on:
November 23, 2017, 05:27:40 pm »
Wrong expectations.
That file is overwritten on boot.
Edit dnsmasq from the webGUI.
«
Last Edit: November 23, 2017, 07:10:20 pm by weust
»
Logged
Hobbyist at home, sysadmin at work. Sometimes the first is mixed with the second.
franco
Administrator
Hero Member
Posts: 17660
Karma: 1611
Re: /var/etc/dnsmasq-hosts is overwritten on dnsmasq restart
«
Reply #3 on:
November 23, 2017, 07:09:00 pm »
We should start from the top: what are you trying to do?
Cheers,
Franco
Logged
ziel
Newbie
Posts: 7
Karma: 2
Re: /var/etc/dnsmasq-hosts is overwritten on dnsmasq restart
«
Reply #4 on:
November 27, 2017, 04:20:23 pm »
What I wanted to do: have a list of over 3000 hosts, mostly advertising related (adclick etc. taken from
https://pgl.yoyo.org/adservers/
) that I want to redirect to an internal Adress (where I have set up a black-hole server wich simply logs all requests but returns 404). I would be very time expensive to add all those hosts manually over GUI (https://<opnsense>/services_dnsmasq.php) so I thought I can simply add the host-list to the file mentioned.
OK, I think I understand that the system is working as designed - somehow (I still do not see behind the curtain..)
Maybe I should post a feature-request to be able to upload a list of hosts?
Or is it possible to add the dnsmasq-config -option (probably this directive is use to point to /var/etc/dnsmasq-hosts)
# or if you want it to read another file, as well as /etc/hosts, use
# this.
addn-hosts=<some-other-file>
Logged
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: /var/etc/dnsmasq-hosts is overwritten on dnsmasq restart
«
Reply #5 on:
November 27, 2017, 06:28:48 pm »
You may want to read this ticket:
https://github.com/opnsense/plugins/issues/229
In includes links and comments which may help you.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
17.7 Legacy Series
»
/var/etc/dnsmasq-hosts is overwritten on dnsmasq restart