without dns server in gui - apt won't work

Najkon

Member
Sep 20, 2021
5
0
21
39
Hi,
I wonder where it is, it hides the property when there are no specific DNS servers in the proxmox GUI (System -> DNS)

- Zrzut ekranu 2024-07-9 o 12.27.48.png

apt cannot resolve any domain

Code:
~# apt-get update
Ign:1 http://ftp.debian.org/debian bookworm InRelease
Ign:2 http://download.proxmox.com/debian/pve bookworm InRelease
Ign:3 http://security.debian.org bookworm-security InRelease
[...]
Err:1 http://ftp.debian.org/debian bookworm InRelease
  Temporary failure resolving 'ftp.debian.org'
Err:3 http://security.debian.org bookworm-security InRelease
  Temporary failure resolving 'security.debian.org'
Err:2 http://download.proxmox.com/debian/pve bookworm InRelease
  Temporary failure resolving 'download.proxmox.com'
Err:9 http://deb.debian.org/debian bookworm InRelease
  Temporary failure resolving 'deb.debian.org'

even though all other commands work without any problems from the console
Code:
~# host ftp.debian.org
ftp.debian.org is an alias for debian.map.fastlydns.net.
debian.map.fastlydns.net has address 146.75.122.132
debian.map.fastlydns.net has IPv6 address 2a04:4e42:8d::644

~# host security.debian.org
security.debian.org has address 151.101.194.132
security.debian.org has address 151.101.2.132
[...]

~# ping security.debian.org
PING security.debian.org (151.101.194.132) 56(84) bytes of data.
64 bytes from 151.101.194.132 (151.101.194.132): icmp_seq=1 ttl=56 time=17.6 ms
64 bytes from 151.101.194.132 (151.101.194.132): icmp_seq=2 ttl=56 time=17.6 ms
^C
--- security.debian.org ping statistics ---

but! of course, entries in /etc/resolv.conf are added manually
Code:
~# cat /etc/resolv.conf
nameserver 1.1.1.1
nameserver 8.8.8.8
 
do you possibly have weird settings in /etc/gai.conf? I don't think APT does anything special w.r.t. DNS resolution.. also, our parser for resolv.conf is quite simple, I am surprised you don't see anything on the UI (is there an error in the dev console of the browser when you select the DNS panel on the UI?)
 
@fabian The file /etc/gai.conf settings are default, nothing has been changed.
I didn't check it from the development console, and now after fix it, which consisted of entering anything via the GUI in Search domain field, which of course overwrote the /etc/resolv.conf file locally on the server, next I manually edited again file /etc/resolv.conf and a second later also GUI showed these settings :)

When installing Proxmox in the network stage, I simply did not enter the DNS (I left it blank). And in the process of preparing the server using automation scripts (ssh/rsync), I uploaded the "standard" resolv.conf file to all servers and the script performed the rest of the installation (installation of additional software, adding users, including to the GUI, etc.) After a week, maybe more.. when I wanted to update using APT, this problem occurred and I was surprised :)