diff options
Diffstat (limited to 'talpid-core/src')
| -rw-r--r-- | talpid-core/src/dns/linux/static_resolv_conf.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/talpid-core/src/dns/linux/static_resolv_conf.rs b/talpid-core/src/dns/linux/static_resolv_conf.rs index 70ff38ddce..1a867a079d 100644 --- a/talpid-core/src/dns/linux/static_resolv_conf.rs +++ b/talpid-core/src/dns/linux/static_resolv_conf.rs @@ -172,6 +172,10 @@ impl DnsWatcher { } fn read_config() -> Result<Config> { + if !std::path::Path::new(RESOLV_CONF_PATH).exists() { + return Ok(Config::new()); + } + let contents = fs::read_to_string(RESOLV_CONF_PATH) .map_err(|e| Error::ReadResolvConf(RESOLV_CONF_PATH, e))?; let config = Config::parse(&contents).map_err(|e| Error::ParseError(RESOLV_CONF_PATH, e))?; |
