chore(gui-client/linux): fix DNS (#4802)

Make the GUI use systemd-resolved to retrieve the system's resolvers.
This allows the IPC service to set up sentinels for those resolvers and
control the system's DNS.

Closes #3812
This commit is contained in:
Reactor Scram
2024-04-26 18:28:47 -05:00
committed by GitHub
parent b93e8870c3
commit 2314b3a128
2 changed files with 2 additions and 6 deletions

View File

@@ -7,12 +7,8 @@ mod imp {
use anyhow::Result;
use std::net::IpAddr;
// TODO: The code here will depend on the chosen DNS control method.
// So that will need to be threaded in here somehow.
#[allow(clippy::unnecessary_wraps)]
pub fn get() -> Result<Vec<IpAddr>> {
tracing::error!("Resolvers module not yet implemented for Linux, returning empty Vec");
Ok(Vec::default())
firezone_headless_client::imp::get_system_default_resolvers_systemd_resolved()
}
}

View File

@@ -139,7 +139,7 @@ fn get_system_default_resolvers_network_manager() -> Result<Vec<IpAddr>> {
}
/// Returns the DNS servers listed in `resolvectl dns`
fn get_system_default_resolvers_systemd_resolved() -> Result<Vec<IpAddr>> {
pub fn get_system_default_resolvers_systemd_resolved() -> Result<Vec<IpAddr>> {
// Unfortunately systemd-resolved does not have a machine-readable
// text output for this command: <https://github.com/systemd/systemd/issues/29755>
//