Can't start BIND9 | Lab 6.1. Configure Caching DNS
Hi guys,
I'm having a problem when starting BIND9 using sudo systemctl start bind9
. I get a random error and when I examine it with sudo systemctl status bind9
, I get this:
bind9.service: Failed with result 'exit-code'.
Failed to start BIND Domain Name Server.
bind9.service: Schedule restart job, restart counter is at 20.
Stopped BIND Domain Name Server.
bind9.service: Start request repeated too quickly.
I set DefaultStartLimitIntervalSec
and DefaultStartLimitBurst
to 40s and 20 respectively on /etc/systemd/system.conf
, so I know it's not because the start requests are coming too quickly.
This is what the logs on /var/log/kern.log
show but I'm new to Linux so I don't know how to recognize and solve the error based on that:
...apparmor="ALLOWED" operation="open profile="named" name="/proc/cmdline" pid=8226 comm="named" requested_mask="r" denied_mas="r" fsuid=0 ouid=0
...apparmor="ALLOWED" operation="open profile="named" name="/proc/sys/kernel/osrelease" pid=8232 comm="named" requested_mask="r" denied_mas="r" fsuid=0 ouid=0
And this is is my /etc/systemd/system/bind9.service
file:
[Unit]
Description=BIND Domain Name Server
Documentation=man:named(8)
After=network.target
Wants=nss-lookup.target
Before=nss-lookup.target
[Service]
Type=forking
EnvironmentFile=-/etc/default/named
ExecStart=/usr/sbin/named $OPTIONS
ExecReload=/usr/sbin/rndc reload
ExecStop=/usr/sbin/rndc stop
Restart=on-failure
[Install]
WantedBy=multi-user.target
Alias=bind9.service
Any help would be very much appreciated!
Thanks!
Best Answers
-
Several ideas, but we are in uncharted territory. We support the long term releases, like Ubuntu 20.04, so testing on your version is not complete. We also have VM's for Ubuntu and others that we recommend; available to download from the Linux Foundation. The best sudgestion is for you to keep your existing VM for now and download and try our Ubuntu 20.04 VM, details are at: https://training.linuxfoundation.org/cm/prep/ near the bottom of the page.
Regards Lee1 -
The "network unreachable" is an IPv6 issue, The complete message is something like this:
Notice the addresses that start with 2001:5
Our internal networks are IPv4 only so we can instruct bind to not use IPv6 by adding an option to the default bind configuration file /etc/default/named. The option to be added is "-4" . Image included.
After restarting the service the IPv6 entries should be gone.
Catch up to here then we can look at the serverfail message, please include the entire output. Here is a copy of my "dig" command:
Lee
1 -
But I say that I half-solved it because it works only when my VPN is off. When it's enabled, the dig query fails with a Unable to fetch DNSKEY error on status bind9
Note: it seems I had Carlos in the today's LFS211 Office Hours, and we fixed the issue related to the VPN (we changed the VM's network configuration from NAT to bridged).
Regards,
Luis.1
Answers
-
EDIT: Taking as a guidance the
denied_mask=r
from the logs, I added to the named profile on apparmor (/etc/apparmor.d/usr.sbin.named
), the two path from the errors with the masks where they were denied for (r):/proc/cmdline
as@{PROC}/cmdline r
/proc/sys/kernel/osrelease
as@{PROC}/sys/kernel/osrelease r
And now the error that I get in the logs is:
...appamor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="syslog-ng" pid=9486 common="apparmor_parser"
And stopping or disabling apparmor with
sudo systemctl stop|disable apparmor
doesn't solve the issue either.(In case I wasn't supposed to do this modification, please let me know and I'll revert the changes)
0 -
Thank you for letting us know you encountered a difficulty. A couple quick things, are you using one of the Linux Foundation virtual machines or your own install? The lab is designed and tested without Apparmor or SELinux,
0 -
I might sudgest un-installing Apparmor initially so we can focus on the dns server.
Lee
0 -
Thanks for the answer, @lee42x !
I uninstalled
apparmor
, checked that it was properly uninstalled, and restarted Ubuntu, but I still get the same error about requests being repeated too quickly, and this time I don't get any error logs to examine on/var/log/kern.log
0 -
And I installed my own version of Ubuntu 21.10 on an Oracle box VM
0 -
Any ideas? @lee42x
0 -
As an aside, we do not support Ubuntu 21.04. So thanks for helping to figure out the future needs, but this is a testing release of Ubuntu and exactly how they mucked things up is not a priority to figure out IMHO
0 -
Thank you, Lee!
That worked.
0 -
Hey @lee42x ,
I'm still having issues.
I downloaded and installed LF's VM like you advised from that link, then just added the config from Lab 6.1 to
/etc/bind/named.conf.options
but I'm getting SERVFAIL on every DNS query to the server.I found just another post on the forum from another person with this issue where his problem was the firewall but I don't have
firewalld
enabled (like I mentioned, the only thing I did was to add the options to thenamed
conf file)I'm getting also
network unreachable
onsystemctl status bind9
0 -
0
-
Hey @lee42x ,
I'm still having issues.
I had to remove LF's VM since it hanged after some minutes of using it pretty much every time. I reinstalled it four times, decreasing RAM to 1024M (I had 2048M before), increasing CPU processors to 2 from 1, enabling/disabling 3D Acceleration but always hanged, and it only happened with this specific VM and not with the others.
So I downloaded 20.4.3 LTS from Ubuntu's site and this is the new error I'm getting:
I know it's related to this file but my current knowledge doesn't allow me to understand what the problem is:
I found these two closed issues on the problem, but again, my current skillset is low to understand the solution:
https://gitlab.isc.org/isc-projects/bind9/-/issues/2769
https://gitlab.isc.org/isc-projects/bind9/-/issues/2728Thanks again for your help, Lee.
0 -
I half-solved it.
I had to add some extra options on
/etc/bind/named.conf.options
:dnssec-enable no; dnssec-lookaside auto;
And deleted both
/var/cache/bind/managed-keys.bind
and/var/cache/bind/managed-keys.bind.jnl
.When I restarted bind, these two files got auto-created but with a key inserted within KEYDATA which wasn't there before.But I say that I half-solved it because it works only when my VPN is off. When it's enabled, the
dig
query fails with aUnable to fetch DNSKEY
error onstatus bind9
How can I make queries while having a VPN enabled?
0 -
I have a typo on my first new post that I can't edit. I meant
Ubuntu 20.04.3 LTS
0 -
Correct! Your solution worked like a charm.
Thanks again for your help, Luis.
Cheers!
1 -
And for anyone referencing this thread in the future, I removed the options from below since they were prompting some deprecated warnings on
systemctl status bind9
:dnssec-enable no;
dnssec-lookaside auto;0 -
Thank you also for your input, @coop.
Very much appreciated!
0
Categories
- All Categories
- 167 LFX Mentorship
- 219 LFX Mentorship: Linux Kernel
- 795 Linux Foundation IT Professional Programs
- 355 Cloud Engineer IT Professional Program
- 179 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 127 Cloud Native Developer IT Professional Program
- 112 Express Training Courses
- 112 Express Courses - Discussion Forum
- 6.2K Training Courses
- 48 LFC110 Class Forum - Discontinued
- 17 LFC131 Class Forum
- 35 LFD102 Class Forum
- 227 LFD103 Class Forum
- 14 LFD110 Class Forum
- 39 LFD121 Class Forum
- 15 LFD133 Class Forum
- 7 LFD134 Class Forum
- 17 LFD137 Class Forum
- 63 LFD201 Class Forum
- 3 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 2 LFD237 Class Forum
- 23 LFD254 Class Forum
- 697 LFD259 Class Forum
- 109 LFD272 Class Forum
- 3 LFD272-JP クラス フォーラム
- 10 LFD273 Class Forum
- 152 LFS101 Class Forum
- 1 LFS111 Class Forum
- 1 LFS112 Class Forum
- 1 LFS116 Class Forum
- 1 LFS118 Class Forum
- LFS120 Class Forum
- 7 LFS142 Class Forum
- 7 LFS144 Class Forum
- 3 LFS145 Class Forum
- 1 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 1 LFS157 Class Forum
- 33 LFS158 Class Forum
- 8 LFS162 Class Forum
- 1 LFS166 Class Forum
- 1 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 1 LFS178 Class Forum
- 1 LFS180 Class Forum
- 1 LFS182 Class Forum
- 1 LFS183 Class Forum
- 29 LFS200 Class Forum
- 736 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 14 LFS203 Class Forum
- 102 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 48 LFS241 Class Forum
- 42 LFS242 Class Forum
- 37 LFS243 Class Forum
- 15 LFS244 Class Forum
- LFS245 Class Forum
- LFS246 Class Forum
- 50 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 154 LFS253 Class Forum
- LFS254 Class Forum
- LFS255 Class Forum
- 5 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.3K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 111 LFS260 Class Forum
- 159 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 20 LFS267 Class Forum
- 24 LFS268 Class Forum
- 29 LFS269 Class Forum
- 1 LFS270 Class Forum
- 199 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 9 LFW111 Class Forum
- 260 LFW211 Class Forum
- 182 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 782 Hardware
- 198 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 83 Storage
- 743 Linux Distributions
- 80 Debian
- 67 Fedora
- 15 Linux Mint
- 13 Mageia
- 23 openSUSE
- 143 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 348 Ubuntu
- 461 Linux System Administration
- 39 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 90 Linux Security
- 77 Network Management
- 101 System Management
- 46 Web Management
- 64 Mobile Computing
- 17 Android
- 34 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 371 Off Topic
- 114 Introductions
- 174 Small Talk
- 19 Study Material
- 507 Programming and Development
- 285 Kernel Development
- 204 Software Development
- 1.8K Software
- 211 Applications
- 180 Command Line
- 3 Compiling/Installing
- 405 Games
- 309 Installation
- 97 All In Program
- 97 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)