Default DNS resolver

,

NethServer Version: 7.7.1908
Module: Backup, Cockpit, Subscription
Hardware: ZOTAC ZBOX nano C327
Kernel: 5.4.8-1.el7.elrepo.x86_64

Hello,
After activating the second network interface I lost the name resolution. In the /etc/resolv.conf there was just nameserver 127.0.0.1 inside.
So I entered 8.8.8.8 and everything is working again for now. But after each reconfiguration this entry will be overwritten again.

I was looking for another way to set a permanent default value. So I edited the /etc/sysconfig/network-scripts/ifcfg-* file of the green interface DNS1=8.8.8.8

This did not help, because the entry disappears again.
The next attempt was to added to /etc/e-smith/templates/etc/resolv.conf/40dnsRole/Resolver
$OUT .=“nameserver 8.8.8.8\n”

Nothing helps and I’m out of ideas. So here’s the question:
Where can I store the default DNA resolver?

Why is there no possibility to configure the name resolver in the frontend?

Sincerly, Marko

Ps.: in principle, the activation of a second interface or configuration changes should not lead to the loss of name resolution

From Cockpit, you can find it on Dashboard > DNS.

1 Like

is this configuration persistent?

What is the primary config file?

Yes, it should be persistent.
Values are saved in a db property (config show dns) and put into dnsmasq config file (/etc/dnsmasq.conf) through template system.


saving not possible

validator only supports IPv4 addresses

1 Like

OMG - no IPv6-Support in 2020? :sob:

CentOS supports it but the UIs are not yet ready for it and no estimate timeline.
But it shall work from the command line:

1 Like

I understand, thank you for clarification.

I configured an DNS-Resolver inside the Cockpit Gui, Saving without errors.
image

If I test it via dig…

There overrides another config…

nano /etc/resolv.conf

image

Maybe it is because of the manual config you did to resolv.conf

You shouldn’t override default template files as they might be replaced with updates.

Thank you for the hint …wehre is ist? Where can I find the right default template?

I found a basic problem with CentOS:
It seems that by default the network manager does not connect the network interfaces. I changed this behavior in the file /etc/sysconfig/network-scripts/ifcfg-eth* with NM_CONTROLLED=yes and restarted the network manager. The individually defined DNS servers now exist permanently after all.

DNS resolution is delegated from resolv.conf to dnsmasq:

you may create a templates-custom…

mkdir -p /etc/e-smith/templates-custom/etc/resolv.conf/

…putting desired nameserves into something like /etc/e-smith/templates-custom/etc/resolv.conf/39dnsCustomResolver

Something similar is supposedly done on template expansion when dnsmasq is not used/enabled.

AFAIK NethServer does not make use of Network Manager.

1 Like

Thank you for your patience.

Step by step I hope to climb the tree of knowledge. There is a realization growing within me…
I should forget my Linux console (especially the CentOS-Config files) and preferably administrate everything via the Server Manager of Nethserver.

For special cases I should use the template system of Nethserver, because all config files are generated on Linux level…

Is that right?

If so, how do I get a structured introduction to the template system?

In short, within /etc/e-smith/templates/ the directory hierarchy for the config files managed by NethServer is recreated in order for the templates (fragments) to programmatically generate config files. Some events (config change, update…) trigger the expansion of related templates that build the resulting config file.

Behavior of templates can be customized through properties set in plain text database. Those db props are usually set from the server-manager or from the command line.

If desired application behavior cannot be accomplished with default templates and db props, those templates can be extended by custom fragments or override with custom templates.

For better explanation you can take a look at the developer manual.