nameserver into dhcpcd.conf vs resolv.conf Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
vonloschz
Posts: 39
Joined: Wed Apr 21, 2021 4:30 pm

nameserver into dhcpcd.conf vs resolv.conf

Post by vonloschz »

Hello,
when I configure my networking information with static DNS,
the dhcpcd.conf still use static domain_name_servers=9.9.9.9 149.112.112.112 instead of the nameserver I wrote.

I used the dietpi-config / 7 / Ethernet method.

/etc/resolv.conf was updated ... but I feel it take 2 tries to really update that file.


Thanks
User avatar
trendy
Posts: 362
Joined: Tue Feb 25, 2020 2:54 pm

Re: nameserver into dhcpcd.conf vs resolv.conf

Post by trendy »

If you are using static addresses, why are you invoking dhcpcd? This would be used in case of dhcp.
vonloschz
Posts: 39
Joined: Wed Apr 21, 2021 4:30 pm

Re: nameserver into dhcpcd.conf vs resolv.conf

Post by vonloschz »

dhcpcd.conf is used to configure static IP address, router address, and name server.
User avatar
trendy
Posts: 362
Joined: Tue Feb 25, 2020 2:54 pm

Re: nameserver into dhcpcd.conf vs resolv.conf

Post by trendy »

vonloschz wrote: Thu Apr 22, 2021 7:00 pm dhcpcd.conf is used to configure static IP address, router address, and name server.
It's a feature, though I don't know why someone would use dhcpcd to configure static IP.
What dietpi does when you select static IP in dietpi-config - Network Option Adapters is to write in the default /etc/network/interfaces and /etc/resolv.conf
vonloschz
Posts: 39
Joined: Wed Apr 21, 2021 4:30 pm

Re: nameserver into dhcpcd.conf vs resolv.conf

Post by vonloschz »

This method is used by Raspberry Pi OS and Debian
to have a mix of dhcp and static clients on multiple nic at the same time.

I understand now that dietpi use dhcpcd.conf for dhcp client only
and the classic /etc/network/interfaces and /etc/resolv.conf for static ip.

all good.
Thanks.
User avatar
Joulinar
Posts: 5688
Joined: Sat Nov 16, 2019 12:49 am

Re: nameserver into dhcpcd.conf vs resolv.conf

Post by Joulinar »

dhcpcd.conf is not touched/used/created by DietPi. If you create it yourself, it will overwrite other settings. For setting up STATIC IP, simply use dietpi-config
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
vonloschz
Posts: 39
Joined: Wed Apr 21, 2021 4:30 pm

Re: nameserver into dhcpcd.conf vs resolv.conf

Post by vonloschz »

I did not manually changed this file.
And I can confirm that dhcpcd.conf file was changed base on dietpi-config execution.

There is a "static routers" info in dhcpcd.conf and this is exactly what I input to dietpi-config while I configured my static networking information.
User avatar
Joulinar
Posts: 5688
Joined: Sat Nov 16, 2019 12:49 am

Re: nameserver into dhcpcd.conf vs resolv.conf

Post by Joulinar »

I did a test on a RPI3B 32bit and the file was not there even on STATIC IP. Did you have installed stuf like PiHole??
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
vonloschz
Posts: 39
Joined: Wed Apr 21, 2021 4:30 pm

Re: nameserver into dhcpcd.conf vs resolv.conf

Post by vonloschz »

re-installing in progress ...

Fresh install base on DietPi_RPi-ARMv8-Buster.7z 2021-04-22.
First boot and continu DietPi as a pure minimal image.
no /etc/dhcpcd.conf

config static + hostname ... still all good.

waiting for my dietpi-software install 66 162 93 21
and yes pi-hole is involve into this process
vonloschz
Posts: 39
Joined: Wed Apr 21, 2021 4:30 pm

Re: nameserver into dhcpcd.conf vs resolv.conf

Post by vonloschz »

bingo ...

/etc/dhcpcd.conf was created right after pi-hole is installed.
The Upstream Quad9 (filtered, DNSSEC) nameserver was writtend down into the option
static domain_name_servers=9.9.9.9 149.112.112.112
Post Reply