Forum › Forums › New users › New Users and General Questions › dnsmasq do not work in antix-19
- This topic has 30 replies, 7 voices, and was last updated Dec 20-7:51 pm by Brian Masinick.
-
AuthorPosts
-
December 10, 2020 at 11:18 am #46990Member
Roberto
I has tried to install dnsmasq in antix-19, but resolvconf do not provide a dns server for dnsmasq to work. The file /run/dnsmasq/resolv.conf is empty, so dnsmasq do not work. I know how to force dnsmasq to use a static resolv.conf file, but I want to use the dynamic one generatated by resolvconf.
Here are the steps I used to install dnsmasq in antix-19:
printf “\nCONNMAN_RUNSTATEDIR_RESOLVCONF=no\nDAEMON_OPTS=\” –nodnsproxy\””>>/etc/default/connman #Disable connman’s dns.
service connman stop;sleep 3;sudo service connman start #Restart connman
mv /etc/resolv.conf /etc/resolv.conf.bak
echo “nameserver 127.0.0.1” > /etc/resolv.conf
apt-get install -y dnsmasqThe installation worked without problems, but dnsmasq do not work. What configuration I need to do for resolvconf and dnsmasq work correctly?
Sorry about the bad english, is not my native language.December 10, 2020 at 7:14 pm #47030Member
Xecure
::If you want a dynamic changed resolv.conf, use a symlink instead.
Also, you will need to explore the relationship between dnsmasq and resolvconf.
For example, in this thread:
https://superuser.com/questions/894513/resolv-conf-keeps-getting-overwritten-when-dnsmasq-is-restarted-breaking-dnsmas
They suggest editing /etc/default/dnsmasq so that dnsmasq doesn’t override resolvconf.
IGNORE_RESOLVCONF=yesI don’t know enough about how networking and masks work to help you. You will need to read more about how this goes or hope someone else in the forum knows how to do what you need.
antiX Live system enthusiast.
General Live Boot Parameters for antiX.December 10, 2020 at 8:34 pm #47036MemberRoberto
::I already knew the method you explained, but that do not solve my problem. If I edit the file “/etc/default/dnsmasq” and write “IGNORE_RESOLVCONF=yes”, dnsmasq will ignore the dynamic dns server list generatated by resolvconf, and this is not what I wanna do.
This option is util to force dnsmasq to use a static resolv.conf file, but as I say before that is not I wanna do.
I need to make resolvconf automaticaly generate a /run/dnsmasq/resolv.conf file for dnsmasq to work. That’s how it worked on Linux mint 17.1 that I used before antiX linux.December 10, 2020 at 8:49 pm #47037Anonymous
::startpage.com search engine
query: connman dnsmasqsearch results #2, #4, #5 each seem to address this exact question
December 10, 2020 at 10:04 pm #47040MemberRoberto
December 13, 2020 at 12:23 pm #47297MemberKeeely
::Hi Roberto,
I’m just going through the process of trying to make dnsmasq do all the stuff I previously did in Slackware, and yes, I do need a caching DNS server, it was on my TODO list, so I had a look today. The information on this was surprisingly hard to come by, making me think this is not the right way, however the following does work for me as I just tested it.
/etc/dnsmasq.conf
listen-address=127.0.0.1 no-resolv resolv-file=/etc/resolv.dnsmasqNotes: Just as an aside, I don’t like the default dnsmasq config of not logging out to a separate file so the first thing I do when getting stuff to work is change the logging options:
log-queries log-facility=/var/log/dnsmasq.logBut that step is optional for you, of course. I also added the following line, just to prove my setup was working:
address=my.domain/127.0.0.1/etc/dhcp/dhclient.conf
prepend domain-name-servers 127.0.0.1;The above line will already be there in antiX just commented out, so comment it in. If dnsmasq is left with default config, this would of course make it try to go up its own backside (which you’ll see in the logs).
/etc/dhcp/dhclient-enter-hooks.d/update_dnsmasq
if [ -n "$new_domain_name_servers" ]; then rm /etc/resolv.dnsmasq for nameserver in $new_domain_name_servers; do if [ "$nameserver" != "127.0.0.1" ]; then echo "nameserver $nameserver" >> /etc/resolv.dnsmasq fi done fihere, /etc/resolv.dnsmasq must match what you have in the dnsmasq.conf file.
The enter hooks are difficult to find information on, as the documentation doesn’t list all the available variables. But you can activate the debug script in antiX (see /etc/dhcp/debug and change the first line to RUN=”yes”. This will at least tell you what you get. Then I was able to craft a script to construct the resolv file specially for dnsmasq. Dnsmasq will poll the resolv file for changes. If you remove it temporarily (as I do above) it will wait for it to be re-written according to the docs.Sources:
http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html. (Notes section at the end talks about this).
http://manpages.ubuntu.com/manpages/bionic/man8/dhclient-script.8.html
/etc/dhcp/debugHope this helps.
December 13, 2020 at 2:50 pm #47307MemberRoberto
::Hi Keeely,
First of all, thank you for try to solve my problem.
I tried the solution you posted and has another problem. I used connman system tray to disconnect and reconect to wireless, but no “/etc/resolv.dnsmasq” is generated. After that, I typed “sudo dhclient” in terminal and the file “/etc/resolv.dnsmasq” was finally genereated.
Have I to typed “sudo dhclient” in terminal every time I want the file “/etc/resolv.dnsmasq” to be updated?
How to automate the update of the “/etc/resolv.dnsmasq” file? I want the file to be updated every time I connect to the network.December 13, 2020 at 3:19 pm #47308Moderator
caprea
::Might helps, in cmst > preferences you can mark the “Advanced Controls” under interfaces.
Afterwards it is possible to write a command
in “External Programs” “After Connect”December 13, 2020 at 8:16 pm #47342MemberKeeely
::I tried the solution you posted and has another problem.
Ah, sorry. I’m using antiX Core, perhaps it doesn’t use connman. In fact I hadn’t heard what that was before today :(. Looks like caprea’s idea is the way to go.
December 14, 2020 at 12:45 pm #47402MemberRoberto
::caprea,
I wrote “/sbin/dhclient” in “External Programs” “After Connect”, but when I diconnect and reconnect to my wireless network the file “/etc/resolv.dnsmasq” is not created yet, so this solution do not worked for me.December 14, 2020 at 2:34 pm #47404Moderator
caprea
::I think the problem is the missing sudo.
One possibility to work around this would be to change your etc/sudoers/ file
But might better wait if someone else has an idea.December 14, 2020 at 3:23 pm #47407Moderator
Brian Masinick
::I think the problem is the missing sudo.
One possibility to work around this would be to change your etc/sudoers/ file
But might better wait if someone else has an idea.I am not an expert in this area either but if the process that is running is owned by root then sudo is not necessary, it’ll be run by a privilege anyway. If there is a different account running the process other than root, that account requires access to the files and directories in use. These statements are true for certain.
--
Brian MasinickDecember 18, 2020 at 9:41 pm #47709MemberRoberto
::caprea, use cmst do not work for me because I have do manualy connect to the wifi network every time a reboot the system. When system starts it automacaly start the wifi network, even if I do not open cmst. I need a solution without user interaction. Besides that, cmst run as normal user, not as root, so I need to use “sudo dhclient” and add permissions in /etc/sudoers/ to this metod works. This is not a good solution.
December 18, 2020 at 10:01 pm #47710Moderator
Brian Masinick
::@Roberto: do you have the antix-wifi-switch program on your system?
On my system, it is at /usr/local/bin/antix-wifi-switch
You can use it to switch between ceni and connman if it is available.
--
Brian MasinickDecember 18, 2020 at 10:40 pm #47717MemberRoberto
::@masinick: no, antix-wifi-switch is not installed. “which antix-wifi-switch” printf nothing.
-
AuthorPosts
- You must be logged in to reply to this topic.