Outils pour utilisateurs

Outils du site


blog

Notes DNS - SystemD - systemd-resolved

Install cache DNS

mkdir /etc/systemd/resolved.conf.d/
chmod 755 /etc/systemd/resolved.conf.d/

Pour RedHat 9

dnf install systemd-resolved

/etc/systemd/resolved.conf.d/dns_servers.conf

[Resolve]
DNS=8.8.8.8 8.8.4.4
Domains=acme.local dev.local
FallbackDNS=
 
# Work on RedHat 9. Before 'no-negative' is ignored, Default is 'yes'
Cache=no-negative
 
#StaleRetentionSec=SECONDS
 
# Fix bug 10 seconds timeout shortname resolution. Ex : '/usr/bin/host plop'
LLMNR=no
 
# Useless / not yet used
MulticastDNS=no
DNSSEC=no
DNSOverTLS=no
chmod 644 /etc/systemd/resolved.conf.d/dns_servers.conf
 
sysctemctl enable --now systemd-resolved.service
 
cp -p /etc/resolv.conf /etc/resolv.conf.bak
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
systemctl status systemd-resolved
 
resolvectl statistics
2025/03/24 15:06

Notes DNS - serveur - Resolver

Dnsmasq

SystemD - systemd-resolved - NetworkManager

Configs différentes par carte réseau

systemctl --now enable systemd-resolved

/etc/NetworkManager/NetworkManager.conf

[main]
dns=systemd-resolved
systemctl reload NetworkManager

Définir ipv4.dns-search et/ou ipv6.dns-search

sudo resolvectl
2025/03/24 15:06

Notes DNS - Dnsmasq

Voir aussi :

Voir :

Stephane Bortzmeyer sur son blog https://www.bortzmeyer.org/9267.html : « Les cas sont nombreux, par exemple SIGRed (CVE-2020-1350) ou DNSpooq (CVE-2020-25681 à CVE-2020-25687). Ces problèmes frappent notamment souvent dnsmasq (personnellement, je n'ai jamais compris pourquoi ce logiciel était si utilisé, mais c'est une autre histoire). »

Install

yum install dnsmasq

Conf pour Cache en local

/etc/dnsmasq.conf

domain-needed
bogus-priv
interface=lo
bind-interfaces
listen-address=127.0.0.1
cache-size=1000
resolv-file=/etc/resolv.dnsmasq
no-poll
no-negcache
#neg-ttl=3600
#no-hosts
 
## log host queries
#log-queries
#log-facility=/var/log/dnsmasq.log

/etc/resolv.dnsmasq

nameserver 8.8.8.8
nameserver 8.8.4.4

/etc/resolv.conf

nameserver 127.0.0.1
options edns0
no-aaaa
2025/03/24 15:06

Notes DKMS et construction paquet Debian netatop

DKMS

Netatop DKMS :

Error!  Build offailed for:
Consult the make.log in the build directory

On met le code source dans /usr/src/netatop-0.7

On créer un fichier dkms.conf

/usr/src/netatop-0.7/dkms.conf

PACKAGE_NAME="netatop"
PACKAGE_VERSION="0.7"
MAKE="make"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="netatop"
DEST_MODULE_LOCATION[0]="/updates"
AUTOINSTALL="yes"
REMAKE_INITRD=no
dkms add -m netatop -v 0.7
Creating symlink /var/lib/dkms/netatop/0.7/source ->
                 /usr/src/netatop-0.7

DKMS: add completed
dkms build -m netatop -v 0.7
Error!  Build of netatop.ko failed for: 3.16.0-4-amd64 (x86_64)
Consult the make.log in the build directory

Si erreur on copie le Makefile, que l'on modifiera

cp -p Makefile Makefile.dkms
vim Makefile.dkms

/usr/src/netatop-0.7/Makefile.dkms

all:
                ./mkversion
                cd module; make
                cp -p ./module/netatop.ko .
 
clean:
                cd module; make clean

On modifie me fichier dkms.conf pour que make prend le nouveau Makefile.dkms

/usr/src/netatop-0.7/dkms.conf

PACKAGE_NAME="netatop"
PACKAGE_VERSION="0.7"
MAKE="make -f Makefile.dkms"
CLEAN="make -f Makefile.dkms clean"
BUILT_MODULE_NAME[0]="netatop"
DEST_MODULE_LOCATION[0]="/updates"
AUTOINSTALL="yes"
REMAKE_INITRD=no

Puis

dkms build -m netatop -v 0.7

Construction d'un paquet Debian

dkms mkdeb -m netatop -v 0.7
cp -p /var/lib/dkms/netatop/0.7/deb/netatop-dkms_0.7_all.deb ~

Reset : On remet tous à neuf

make clean
dkms remove -m netatop -v 0.7 -k all
rm /var/lib/dkms/netatop -rf

On test

dpkg -i netatop-dkms_0.7_all.deb
DKMS: add completed.
First Installation: checking all kernels...
Building only for 3.16.0-4-amd64
Building for architecture amd64
Building initial module for 3.16.0-4-amd64
Error! Bad return status for module build on kernel: 3.16.0-4-amd64 (amd64)
Consult /var/lib/dkms/netatop/0.7/build/make.log for more information.

Voyons ça /var/lib/dkms/netatop/0.7/build/make.log

DKMS make.log for netatop-0.7 for kernel 3.16.0-4-amd64 (amd64)
dimanche 8 mai 2016, 22:05:44 (UTC+0200)
./mkversion
make: execvp: ./mkversion: Permission non accordée
Makefile.dkms:2: recipe for target 'all' failed
make: *** [all] Error 127

La solution la plus simple, on ajoute un chmod +x dans le Makefile.dkms

Makefile.dkms

all:
        chmod +x ./mkversion ./netatop.init
        ./mkversion
        cd module; make
        cp -p ./module/netatop.ko .
 
clean:
        cd module; make clean

Notes

Status

dkms status -m netatop

Reset : On remet tous à neuf

make clean
dkms remove -m netatop -v 0.7 -k all
rm /var/lib/dkms/netatop -rf

Module linux

rmmod netatop
modprobe netatop
depmod -a

Exemple de conf

dkms.conf

PACKAGE_NAME="e1000e"
PACKAGE_VERSION="3.4.2.4"
MAKE[0]="cd src/ && make KVERSION=$kernelver BUILD_KERNEL=$kernelver"
CLEAN="cd src/ && make clean"
BUILT_MODULE_NAME[0]="e1000e"
BUILT_MODULE_LOCATION[0]="src/"
DEST_MODULE_LOCATION[0]="/updates"
REMAKE_INITRD="yes"
AUTOINSTALL="yes"

Source : https://github.com/kelebek333/e1000e-dkms/blob/master/dkms.conf

2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki