LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-02-2024, 12:16 PM   #1
mw.decavia
Member
 
Registered: Feb 2024
Distribution: Slackware64-15 & Afterstep , oh my
Posts: 78

Rep: Reputation: 8
trying to use networkmanager with bind9


I am a newb to wifi.
My machine is slackware64-15 using a realtek rtl8812au. I built the realtek driver from it's github repo. And that works.

Right now I use networkmanager (nmcli) to connect out as a client. I am a newb to networkmanager. Maybe someday I might get more advanced.

In the past I had setup several slackware bind9 dns servers for my Local lan, using wired ethernet and static ip addresses, no networkmanager. And they worked.

I even setup a raspberry 4b as a bind9 dns server, with wired ethernet and static ip, and it worked.

Right now, it would be good to run a local caching bind9 dns server on this machine, the one which is connecting out using networkmanager.

The docs say that networkmanager is all set to run dnsmasq, if I choose. But I do not like dnsmasq, I want to use bind9.

But substituting "named" or "bind" for "dnsmasq" in the networkmanager conf files, does not start bind.

If I start bind9 myself in the rc.d system startup, and set 127.0.0.1 in the resolv.conf, and set networkmanager to ignore dhcp acquired dns server(s), bind9 is started but networkmanager never passes any requests to it.

I searched for the subject online, and found people using other distros who made bind work with networkmanager. I am sure there are many subtleties involved which I know nothing about.

If anyone could advise me re: the solution, it would help and I would thank you
 
Old 03-02-2024, 04:26 PM   #2
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by mw.decavia View Post
If I start bind9 myself in the rc.d system startup, and set 127.0.0.1 in the resolv.conf, and set networkmanager to ignore dhcp acquired dns server(s), bind9 is started but networkmanager never passes any requests to it.
What do you mean by "networkmanager never passes any requests to it"?

Your applications like firefox and ping are supposed to ask the DNS servers listed in /etc/resolv.conf, assuming that your hosts-row in /etc/nsswitch.conf has "dns" on the on the "hosts:" line.

Does "ping www.google.com" cause a lookup in your local DNS server? (This can be studied with strace if you haven't configured bind to log all requests)

If not, is 127.0.0.1 still in /etc/resolv.conf and does /etc/nsswitch.conf have "dns" in the "hosts:" line?

I don't have much experience from networkmanager, but its task is to configure your network settings and those settings might include the DNS settings in /etc/resolv.conf.

Having a caching DNS server might be a good idea, but I would prefer to have that on some "server" in the local network with a static IP address rather than on each DHCP client. Once you have your own static DNS server(s) you can also configure your DHCP server to provide the addresses of your static DNS server(s).

regards Henrik
 
1 members found this post helpful.
Old 03-03-2024, 10:01 AM   #3
mw.decavia
Member
 
Registered: Feb 2024
Distribution: Slackware64-15 & Afterstep , oh my
Posts: 78

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by henca View Post
What do you mean by "networkmanager never passes any requests to it"?

Your applications like firefox and ping are supposed to ask the DNS servers listed in /etc/resolv.conf, assuming that your hosts-row in /etc/nsswitch.conf has "dns" on the on the "hosts:" line.

Does "ping www.google.com" cause a lookup in your local DNS server? (This can be studied with strace if you haven't configured bind to log all requests)

If not, is 127.0.0.1 still in /etc/resolv.conf and does /etc/nsswitch.conf have "dns" in the "hosts:" line?
Yes, with 127.0.0.1 still in /etc/resolv.conf, and with /etc/nsswitch.conf having "dns" in the "hosts:" line.

This is what happens -

Code:
% ping www.google.com
ping: www.google.com: Temporary failure in name resolution
Code:
% dig www.google.com

;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 11834
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: b0f7af01dbc2dcba0100000065e33543d02e43954f1f87a5 (good)
;; QUESTION SECTION:
;www.google.com.           IN      A

;; Query time: 4999 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Mar 02 19:18:43 +05 2024
;; MSG SIZE  rcvd: 76
Also, after these attempted lookups "%rndc stats" shows that named has counted no requests.

Quote:
Originally Posted by henca View Post
I don't have much experience from networkmanager, but its task is to configure your network settings and those settings might include the DNS settings in /etc/resolv.conf.

Having a caching DNS server might be a good idea, but I would prefer to have that on some "server" in the local network with a static IP address rather than on each DHCP client. Once you have your own static DNS server(s) you can also configure your DHCP server to provide the addresses of your static DNS server(s).

regards Henrik
Right now my network needs to be portable. If there is no solution to networkmanager using bind on slackware, then plan-b is that I still have my Raspberry Pi 4b which has bind9 setup and working. I can configure the Pi to use "gadget mode" ip-over-usb, connecting back to my laptop pc. But then the 2 things are less portable than 1.
 
Old 03-04-2024, 12:52 AM   #4
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Obviously dig attempts to connect to 127.0.0.1. My guess is that your problem is that bind was started before your current network configuration was up and running. It might work better if you do:

Code:
/etc/rc.d/rc.bind restart
...after your network has been configured.

regards Henrik
 
Old 03-04-2024, 05:01 AM   #5
viel
Member
 
Registered: Jul 2021
Location: Arcadia
Distribution: Slackware
Posts: 47

Rep: Reputation: Disabled
Hi,

I am not using Networkmanager because for me is an extra layer of painful and i don't know to many about it but ...

Quote:
Originally Posted by mw.decavia View Post
If I start bind9 myself in the rc.d system startup, and set 127.0.0.1 in the resolv.conf, and set networkmanager to ignore dhcp acquired dns server(s), bind9 is started but networkmanager never passes any requests to it.
Can you see the networkmanager config for your link?

Code:
[root@arcadia ncdu]# nmcli con show eth0 | grep dns
connection.mdns:                        -1 (default)
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       --
ipv4.dns-priority:                      100
ipv4.ignore-auto-dns:                   no
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       --
ipv6.dns-priority:                      100
ipv6.ignore-auto-dns:                   no
[root@arcadia ncdu]#
Edited: There is some problem with networkmanger that don't agree with the config for sure, if you shut down networkmanager and set up wifi manualy dns work?

Hope that helps.

Viel.

Last edited by viel; 03-04-2024 at 05:14 AM.
 
1 members found this post helpful.
Old 03-04-2024, 01:22 PM   #6
mw.decavia
Member
 
Registered: Feb 2024
Distribution: Slackware64-15 & Afterstep , oh my
Posts: 78

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by henca View Post
Obviously dig attempts to connect to 127.0.0.1. My guess is that your problem is that bind was started before your current network configuration was up and running. It might work better if you do:

Code:
/etc/rc.d/rc.bind restart
...after your network has been configured.

regards Henrik
I have restarted networkmanager, and restarted the system, and cold booted. Doing that changes nothing.

Quote:
Originally Posted by viel View Post
Hi,

I am not using Networkmanager because for me is an extra layer of painful and i don't know to many about it but ...



Can you see the networkmanager config for your link?

Code:
[root@arcadia ncdu]# nmcli con show eth0 | grep dns
connection.mdns:                        -1 (default)
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       --
ipv4.dns-priority:                      100
ipv4.ignore-auto-dns:                   no
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       --
ipv6.dns-priority:                      100
ipv6.ignore-auto-dns:                   no
[root@arcadia ncdu]#
Edited: There is some problem with networkmanger that don't agree with the config for sure, if you shut down networkmanager and set up wifi manualy dns work?

Hope that helps.

Viel.
If I use "nmcli con show $ssidname | grep dns" I get almost the same result as you did, except the dns-priority is 0.

I am starting to think it maybe impossible to combine networkmanager and bind on slackware. For all the many slackware users, if it was possible, I would expect that someone would have done it and written about it online.

So over the weekend I did my plan-b and made my Rpi 4b working again, it was already configured as a working bind9 dns server. I could not get "gadget mode" to work, because my laptop pc's usb ports do not provide enough power to run the 4b. My spare powered usb hubs do not provide enough power either. So it is using ethernet.

It needs to share my (dual-boot) laptop's wifi connection, so it can reach it's upstream dns servers. It was easy to have windows connection sharing. Next is to have slackware networkmanager share the connection, then this task will be finished.
 
Old 03-04-2024, 03:48 PM   #7
viel
Member
 
Registered: Jul 2021
Location: Arcadia
Distribution: Slackware
Posts: 47

Rep: Reputation: Disabled
So u need to set Networkmanager dns for your link.

like

Code:
nmcli con mod "$connectionName" ipv4.dns "8.8.8.8 8.8.4.4"
but with your link and your dns maybe

Code:
nmcli con mod wlan0 ipv4.dns "127.0.0.1"

Last edited by viel; 03-04-2024 at 03:50 PM.
 
Old 03-04-2024, 09:48 PM   #8
mw.decavia
Member
 
Registered: Feb 2024
Distribution: Slackware64-15 & Afterstep , oh my
Posts: 78

Original Poster
Rep: Reputation: 8
I think I have found out the problem now, but not yet the solution -
It appears networkmanager will only use interfaces that it is set to manage, but by default it is not configured to manage the loopback.

Concurrently, I have configured networkmanager to use my Rpi 4b for dns. So my task is finished.

Quote:
Originally Posted by viel View Post
So u need to set Networkmanager dns for your link.

like

Code:
nmcli con mod "$connectionName" ipv4.dns "8.8.8.8 8.8.4.4"
but with your link and your dns maybe

Code:
nmcli con mod wlan0 ipv4.dns "127.0.0.1"
 
Old 03-05-2024, 12:38 AM   #9
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by henca View Post
My guess is that your problem is that bind was started before your current network configuration was up and running. It might work better if you do:

Code:
/etc/rc.d/rc.bind restart
...after your network has been configured.
Quote:
Originally Posted by mw.decavia View Post
I have restarted networkmanager, and restarted the system, and cold booted. Doing that changes nothing.
The problem here might be that bind is a serious service intended for serious servers and networkmanager is a toy functionality intended for toy computers.

A serious server has a static IP address well known by every computer in the network depending on the serious server. Any services run on this serious server like httpd, sendmail and bind will at their start time bind(2) (see man bind for the API call to bind, not to be confused with the named program) bind sockets to this well known IP address.

For this reason, all serious services on a serious server will be started at boot time after the network interfaces are up with their static addresses.

On a toy computer you might not have any network interfaces configured after boot. Instead, the toy computer might be configured to allow a normal user to point and click to choose to connect to different networks. On such a toy computer you will need to make sure that any serious service is started after the network is up. As you manually started your network after boot you will also have to manually start such services after you started your network.

regards Henrik

Last edited by henca; 03-05-2024 at 12:39 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] I can't manage NetworkManager via /etc/rc.d/rc.networkmanager script igadoter Slackware 20 03-22-2018 03:17 PM
[SOLVED] college studant first time debian and bind9 user, trying to do a school project. storms Linux - Server 7 02-17-2017 04:41 PM
Trying to compile Robby's networkmanager-openconnect from SBO fails. vdemuth Slackware 10 06-02-2013 05:52 AM
Gentoo: Trying to get my wireless card working with NetworkManager kahlil88 Linux - Networking 2 04-15-2009 11:48 AM
windows client can't use ubuntu bind9 DNS service and12345 Linux - Networking 1 12-07-2008 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration