Skip to content

Fix DNS resolution issue during installation #1248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 12, 2025

Conversation

Paul1404
Copy link
Contributor

@Paul1404 Paul1404 commented Mar 9, 2025

Problem

The current installation script creates a potential catch-22 situation:

  1. The script sets the system's DNS resolver to 127.0.0.1 (pointing to the newly installed DNS server)
  2. If the system is missing the required libicu package, the DNS server fails to start
  3. With no functioning DNS server and resolv.conf pointing to localhost, the system can't resolve domain names
  4. This prevents users from using package managers to install the missing libicu package, requiring manual intervention

Background

I encountered this issue on one of our RHEL systems while deploying Technitium DNS Server. Since Technitium is an incredible DNS server, I wanted to contribute to making it even better and more user-friendly, especially for those who might not immediately understand why their DNS suddenly stopped working after installation.

Solution

This PR addresses the issue by:

  1. Checking for and installing the required ICU package before modifying resolv.conf
  2. Adding support for multiple package managers with distribution-specific package names:
    • Debian/Ubuntu: libicu74, libicu72, or libicu70 (with fallback)
    • RHEL/Fedora/CentOS: libicu
    • openSUSE: libicu
    • Arch Linux: icu
    • Alpine Linux: icu
  3. Adding a fallback DNS server (1.1.1.1) in resolv.conf as a safety measure
  4. Adding comments in resolv.conf for better documentation

Testing

I've tested this solution on a RHEL system that was missing the ICU package. The modified script:

  • Successfully detected and installed the missing package
  • Properly configured the DNS server

This change improves the user experience, especially for new users or those on minimal distributions where ICU packages aren't installed by default.

Paul1404 added 4 commits March 9, 2025 00:51
- Add ICU package check and installation before modifying resolv.conf
- Support multiple package managers (apt-get, dnf, yum, zypper, pacman, apk)
- Add fallback DNS server (1.1.1.1) in resolv.conf
- Add comments in resolv.conf for better documentation
Adjusted distro specific package names
This reverts commit a147ac1.
Support multiple package managers with researched distribution-specific package names:
  - Debian/Ubuntu: libicu74, libicu72, libicu70 (with fallback)
  - RHEL/Fedora/CentOS: libicu
  - openSUSE: libicu
  - Arch Linux: icu
  - Alpine Linux: icu
@ShreyasZare
Copy link
Member

Thanks for the PR. Will check it and let you know soon.

@ShreyasZare ShreyasZare changed the base branch from master to develop April 12, 2025 12:27
@ShreyasZare ShreyasZare merged commit 27afe03 into TechnitiumSoftware:develop Apr 12, 2025
@Paul1404
Copy link
Contributor Author

Hi @ShreyasZare,

Now that the installer changes are live, I wanted to check in and see if there have been any reports of issues or unexpected behavior on any Linux distributions.

I tested the script on RHEL, but since it also handles multiple distros and package managers, I want to make sure everything is working smoothly for Debian, Ubuntu, openSUSE, Arch, Alpine, and others.

As you know, with all the different Linux distributions out there, it’s always possible that something slips through despite our best efforts.

Since the installer script is the main way most users set up Technitium DNS Server on Linux, I want to be sure the experience remains reliable for everyone. If you or any users have noticed any problems or have feedback, please let me know—I'm happy to help troubleshoot or improve the script further if needed.

Thanks again for merging and for all your work on the project!

—Paul

@ShreyasZare
Copy link
Member

@Paul1404 Thanks for asking. There have been no issues reported till now. I had added ICU test CLI option to use with the script so if the ICU package is missing, the installer fails with info on how to fix it. So, at least, there wont be case like before where it would cause system to fail to resolve DNS due to DNS server failing to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants