mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-05 00:29:55 +03:00
Override DNS server for alpine LXC in DHCP mode #576
Closed
opened 2026-02-04 20:02:51 +03:00 by OVERLORD
·
15 comments
No Branch/Tag Specified
main
github-action-update-changelog
pr-update-app-files
docker_deb13
feat/cloudinit-sshkeys
feat/sqlserver2025
automated/update-github-versions
add-script-opencloud-1770212555
add-script-openclaw-1770212634
github-action-archive-changelog
update_apps_tool
add-script-wishlist-1770193085
MickLesk-patch-2
add-script-writefreely-1770188758
add-script-wealthfolio-1770143943
fix/vaultwarden-update-script
remove_memos
disable_npm
feature/codeberg-functions-forgejo-readeck
add-script-rustypaste-1770019426
add-script-kitchenowl-1770017260
fix/2fauth-php-version
tools_func_addcodeberg
CrazyWolf13-patch-2
add-script-shelfmark-1769790178
CrazyWolf13-patch-1
add-script-ampache-1769790139
add-script-languagetool-1769790155
remove_php_deps
ref_koilection
fix/php-module-improvements
tremor021-patch-1
fix/open-archiver-meilisearch-migration
cloudflare_dns
MickLesk-patch-1
michelroegl-brunner-patch-2
fix/version-display
fix/debian13-root-ownership
feat/interactive_prompts
feature/smart-error-recovery
core_stable
update_docs
refactor/tools-func-stability
certbot_npm
2026-02-03
2026-02-02
2026-02-01
2026-01-31
2026-01-30
2026-01-29
2026-01-28
2026-01-27
2026-01-26
2026-01-25
2026-01-24
2026-01-23
2026-01-22
2026-01-21
2026-01-20
2026-01-19
2026-01-18
2026-01-17
2026-01-16
2026-01-15
2026-01-14
2026-01-13
2026-01-12
2026-01-11
2026-01-10
2026-01-09
2026-01-08
2026-01-07
2026-01-06
2026-01-05
2026-01-04
2026-01-03
2026-01-02
2026-01-01
2025-12-31
2025-12-30
2025-12-29
2025-12-28
2025-12-27
2025-12-26
2025-12-25
2025-12-24
2025-12-23
2025-12-22
2025-12-21
2025-12-20
2025-12-19
2025-12-18
2025-12-17
2025-12-16
2025-12-15
2025-12-14
2025-12-13
2025-12-12
2025-12-11
2025-12-10
2025-12-09
2025-12-08
2025-12-07
2025-12-06
2025-12-05
2025-12-04
2025-12-03
2025-12-02
2025-12-01
2025-11-30
2025-11-29
2025-11-28
2025-11-27
2025-11-26
2025-11-25
2025-11-24
2025-11-23
2025-11-22
2025-11-21
2025-11-20
2025-11-19
2025-11-18
2025-11-17
2025-11-16
2025-11-15
2025-11-14
2025-11-13
2025-11-12
2025-11-11
2025-11-10
2025-11-09
2025-11-08
2025-11-07
2025-11-06
2025-11-05
2025-11-04
2025-11-03
2025-11-02
2025-11-01
2025-10-31
2025-10-30
2025-10-29
2025-10-28
2025-10-27
2025-10-26
2025-10-25
2025-10-24
2025-10-23
2025-10-22
2025-10-21
2025-10-20
2025-10-19
2025-10-18
2025-10-17
2025-10-16
2025-10-15
2025-10-14
2025-10-13
2025-10-12
2025-10-11
2025-10-10
2025-10-09
2025-10-08
2025-10-07
2025-10-06
2025-10-05
2025-10-04
2025-10-03
2025-10-02
2025-10-01
2025-09-30
2025-09-29
2025-09-28
2025-09-27
2025-09-26
2025-09-25
2025-09-24
2025-09-23
2025-09-22
2025-09-21
2025-09-20
2025-09-19
2025-09-18
2025-09-17
2025-09-16
2025-09-15
2025-09-14
2025-09-13
2025-09-12
2025-09-11
2025-09-10
2025-09-09
2025-09-08
2025-09-07
2025-09-06
2025-09-05
2025-09-04
2025-09-03
2025-09-02
2025-09-01
2025-08-31
2025-08-30
2025-08-29
2025-08-28
2025-08-27
2025-08-26
2025-08-25
2025-08-24
2025-08-23
2025-08-22
2025-08-21
2025-08-20
2025-08-19
2025-08-18
2025-08-17
2025-08-16
2025-08-15
2025-08-14
2025-08-13
2025-08-12
2025-08-11
2025-08-10
2025-08-09
2025-08-08
2025-08-07
2025-08-06
2025-08-05
2025-08-04
2025-08-03
2025-08-02
2025-08-01
2025-07-31
2025-07-30
2025-07-29
2025-07-28
2025-07-27
2025-07-26
2025-07-25
2025-07-24
2025-07-23
2025-07-22
2025-07-21
2025-07-20
2025-07-19
2025-07-18
2025-07-17
2025-07-16
2025-07-15
2025-07-14
2025-07-11
2025-07-10
2025-07-09
2025-07-08
2025-07-07
2025-07-06
2025-07-05
2025-07-04
2025-07-03
2025-07-02
2025-07-01
2025-06-30
2025-06-29
2025-06-28
2025-06-27
2025-06-26
2025-06-25
2025-06-24
2025-06-23
2025-06-22
2025-06-21
2025-06-20
2025-06-19
2025-06-18
2025-06-17
2025-06-16
2025-06-15
2025-06-14
2025-06-13
2025-06-12
2025-06-11
2025-06-10
2025-06-09
2025-06-08
2025-06-07
2025-06-06
2025-06-05
2025-06-04
2025-06-03
2025-06-02
2025-06-01
2025-05-31
2025-05-30
2025-05-29
2025-05-28
2025-05-27
2025-05-26
2025-05-25
2025-05-24
2025-05-23
2025-05-22
2025-05-21
2025-05-20
2025-05-19
2025-05-18
2025-05-17
2025-05-16
2025-05-15
2025-05-14
2025-05-13
2025-05-12
2025-05-11
2025-05-10
2025-05-09
2025-05-08
2025-05-07
2025-05-06
2025-05-05
2025-05-04
2025-05-03
2025-05-02
2025-05-01
2025-04-30
2025-04-29
2025-04-28
2025-04-27
2025-04-26
2025-04-25
2025-04-24
2025-04-23
2025-04-22
2025-04-20
2025-04-21
2025-04-19
2025-04-18
2025-04-17
2025-04-15
2025-04-16
2025-04-14
2025-04-13
2025-04-12
2025-04-11
2025-04-10
2025-04-09
2025-04-08
2025-04-07
2025-04-06
2025-04-05
2025-04-04
2025-04-03
2025-04-02
2025-04-01
2025-03-31
2025-03-30
2025-03-29
2025-03-28
2025-03-27
2025-03-26
2025-03-25
2025-03-24
2025-03-23
2025-03-22
2025-03-21
2025-03-20
2025-03-19
2025-03-18
2025-03-17
2025-03-16
2025-03-15
2025-03-14
2025-03-13
2025-03-12
2025-03-11
2025-03-10
2025-03-09
2025-03-08
2025-03-07
2025-03-06
2025-03-05
2025-03-04
2025-03-03
2025-03-02
2025-03-01
2025-02-28
2025-02-27
2025-02-26
2025-02-25
2025-02-24
2025-02-23
2025-02-21
2025-02-20
2025-02-19
2025-02-18
2025-02-17
2025-02-16
2025-02-15
2025-02-14
2025-02-13
2025-02-12
2025-02-11
2025-02-10
2025-02-09
2025-02-08
2025-02-07
2025-02-06
2025-02-05
2025-02-04
2025-02-03
2025-02-02
2025-02-01
2025-01-31
2025-01-30
2025-01-29
2025-01-28
2025-01-27
2025-01-26
2025-01-24
2025-01-23
2025-01-22
2025-01-21
2025-01-20
2025-01-19
2025-01-18
2025-01-17
2025-01-16
2025-01-15
2025-01-14
2025-01-13
2025-01-11
2025-01-10
2025-01-09
2025-01-08
2025-01-07
2025-01-06
2025-01-05
2025-01-04
2025-01-03
2025-01-02
2025-01-01
2024-12-31
2024-12-30
2024-12-29
2024-12-28
2024-12-27
2024-12-26
2024-12-25
2024-12-23
2024-12-21
2024-12-20
2024-12-19
2024-12-18
2024-12-17
2024-12-16
2024-12-13
2024-12-12
2024-12-09
2024-12-08
2024-12-07
2024-12-06
2024-12-05
2024-12-04
2024-12-03
2024-12-02
2024-11-30
2024-11-29
2024-11-28
2024-11-27
2024-11-26
2024-11-25
2024-11-24
2024-11-23
Labels
Clear labels
Implemented in VED waiting push to Main
breaking change
bug
bug
bugfix
deferred
delete script
dependencies
enhancement
external
feature
github
help wanted
in project pipeline
invalid
investigation
json
maintenance
needs triage
new script
new script
nice to have
not a script issue
not planned
organization
pull-request
question
refactor
rename script
security
update script
website
wontdo
🛑 Failure to comply with the guidelines
Mirrored from GitHub Pull Request
No Label
enhancement
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/ProxmoxVE#576
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @de666 on GitHub (Mar 3, 2025).
Originally assigned to: @michelroegl-brunner on GitHub.
🌟 Briefly describe the feature
Manage correctly the override of DNS server on alpine LXC in DHCP
📝 Detailed description
As already discussed on discord
https://discord.com/channels/1302816934508630047/1330235805943337144
For alpine based containers, if you select both DHCP and a custom DNS server, the server are not overridden because proxmox writes the correct resolve.conf file but alpine (udhcpc) overwrite it back at every LXC startup putting the DNS servers sent by DHCP server.
It is possible to prevent this action enabling the line
in
/etc/udhcpc/udhcpc.confsee https://wiki.alpinelinux.org/wiki/Udhcpc
So, when an alpine based container is created, if the user select dhcp and doesn't leave dns server empty (i.e. specifies a custom DNS server), the script should enable the option above (modifying the conf file) and this has to be done before doing any dns query (before updating the OS).
💡 Why is this useful?
It's a kind of bug cause now it's not working as expected.
The user who specifies a custom DNS server expects that server is used even if DHCP is selected (otherwise it has no meaning the wizard ask for a DNS server when DHCP is selected).
Furthermore it works well for non alpine (debian/ubuntu) LXC and it should work the same way for alpine containers.
@michelroegl-brunner commented on GitHub (May 5, 2025):
@de666 If added the function to the Dev Repo, can you check if it works as you expected? Test with for example:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/alpine-rclone.sh)"@de666 commented on GitHub (May 5, 2025):
Indeed I can. Please let me know when it will be available and how to test it (the link to the bash script).
@MickLesk commented on GitHub (May 5, 2025):
You can test it with default alpine lxc, its present in Dev Repo
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/alpine.sh)"
@de666 commented on GitHub (May 6, 2025):
@michelroegl-brunner Tested with
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/alpine.sh)"It doesn't seem to work
It gives me a DNS error and the script exit when trying to update Alpine OS, it's not able to resolve the repository url. Looking inside the created container, it seems the content of
/etc/udhcpc/udhcpc.confis not correct, the line#RESOLV_CONF="no"shuold not be commented. As I wrote, that conf file modification has to be done before doing any dns query (before updating the OS).
Maybe the following operations has to be performed in order to get it working:
Please let me know if you need me to test it again
@michelroegl-brunner commented on GitHub (May 6, 2025):
This line is commented by default.
Inthought we need to comment it out?
@de666 commented on GitHub (May 6, 2025):
that line has to be commented out (uncommented) but that is already done the right way from what I see here
cbf47a6962/misc/alpine-install.func (L202)The problem is not that, the problem is that config file mod is done by the script after checking network and updating the OS and it shuold be done before, it shuold be the very first thing the script does immediatley after building the container as I wrote
In other words, the point 2 is already accomplished by the customize function at
cbf47a6962/misc/alpine-install.func (L202)The problem is the customize function is called at the very end of the process so it cannot work because that correction is necessary to make OS update and network check working correctly (which at the moment are performed before the customize function)
af89f730ad/install/alpine-install.sh (L25)I hope I made myself clear, let me know if you need further details about that.
@michelroegl-brunner commented on GitHub (May 6, 2025):
Ah, i see. I changed it around so it is the first thing wich happens befor setting anything else up.
@de666 commented on GitHub (May 6, 2025):
same error and the configuration file is still unmodified (line was not uncommented as it shuold be)
@MickLesk commented on GitHub (May 7, 2025):
You can check it again.
@de666 commented on GitHub (May 7, 2025):
As I pointed out, modifying that file is the very first thing the script shuold do, before everything, even before installing the bash package o any other package couse that involves a DNS lookup. Also, as I wrote, maybe the container has to be restarted after enabling that option, if it is not possibile (I don't know if it is possible) to modify the file after the creation of the container but before starting it.
Furthermore from my point of view that option also can be and shuold be always enabled since the resolve.conf is managed and should be managed by PVE as it is for the debian containers so that file cuold be modified even in the alpine template, regardless of the chosen network configuration.
@MickLesk commented on GitHub (May 7, 2025):
Everything happens exactly as you say it does. It is the first one after the container has been created. A restart is not possible, otherwise it will lose the session.
How you get these messages, idk. You get DNS lookup errors, I don't. I have tested the function several times today.
@de666 commented on GitHub (May 7, 2025):
The errors I get afaik are due to a wrong dns server, that is the reason why I found and proposed this feature.
In the first instance I say it happens the following:
The point 3 is placed in that position based on what you said.
But this is in conflict with what I see after the error looking at the contents of udhcpc.conf of the already started (even if not completely configured) container.
@MickLesk commented on GitHub (May 7, 2025):
lemme test something in pre creation.
@IT-Yohan commented on GitHub (Jun 12, 2025):
Hey, it should be pointed that the problem is the same on Debian based CT's.
The /etc/resolv.conf set by pve gets overwritten by the DHCP client when it fetches the DNS.
My solution was to remove domain-name-servers from the request line in /etc/dhcp/dhclient.conf so that it stops managing it, but it is not ideal do do that each time.
Here's a script that removes this from all my currently running Debian based CT's, for eah of them it creates a backup of the dhclient.conf then removes the domain-name-servers from the request line :
@MickLesk commented on GitHub (Jul 17, 2025):
I have not found a solution to the problem - it would have to be changed hard before the template runs. When creating the container, it's a 50:50 chance whether it takes it over or not. I think our hands are currently bound. If you find a solution to this during runtime before it connects the network, you are welcome to PR it. You are also welcome to post it in the ProxmoxVED repo, where you can find the latest developments.