Skip to content
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

DNS Search Domain not applying #211

Closed
HPPinata opened this issue Feb 5, 2024 · 3 comments
Closed

DNS Search Domain not applying #211

HPPinata opened this issue Feb 5, 2024 · 3 comments

Comments

@HPPinata
Copy link
Contributor

HPPinata commented Feb 5, 2024

The DNS Search Domains field is not included in the generated configuration file despite being set (and applied) in the interface defaults and per client config.

Expected behaviour:
Search domain included in .conf: DNS = 192.168.8.1, lan

Actual behaviour:
Search domain not included in .conf: DNS = 192.168.8.1

The DNS Servers field works as expected, even with multiple entries setting , as necessary

Editing the generated .conf on the client manually to add the search domain works as expected (the core functionality appears to work without issues, just the .conf file generation needs some fixes)

I am aware of issue #46, but that discussed the viability of adding that option and also affected the UI (labeled "enhancement"), this is a bug report for an "existing" but broken feature

I am happy to provide more information and do some testing, but sadly was not able to find/fix this myself.

Versions/Configuration:
Running the Version 2 :latest docker image (hash: 9726fd3f1912f43f69aa591e5628d6e3590a2eb075cf217a96d3b715972ef28a)

config.yml is minimal:

advanced:
  log_level: trace

core:
  admin_user: mail@example.com
  admin_password: passwd
  import_existing: false

web:
  external_url: https://my.domain
  request_logging: true

Defaults:
Screenshot 2024-02-05 113616

Client:
Screenshot 2024-02-05 113711

File:
Screenshot 2024-02-05 113748

@pasztorl
Copy link

same issue here

@mtahernia
Copy link
Contributor

mtahernia commented Mar 11, 2024

I found the solution. Here is the fix:

diff --git a/internal/app/configfile/tpl_files/wg_peer.tpl b/internal/app/configfile/tpl_files/wg_peer.tpl
index 79c9643..8a4bae4 100644
--- a/internal/app/configfile/tpl_files/wg_peer.tpl
+++ b/internal/app/configfile/tpl_files/wg_peer.tpl
@@ -25,7 +25,7 @@ Address = {{ CidrsToString .Peer.Interface.Addresses }}
 
 # Misc. settings (optional)
 {{- if .Peer.Interface.DnsStr.GetValue}}
-DNS = {{ .Peer.Interface.DnsStr.GetValue }}
+DNS = {{ .Peer.Interface.DnsStr.GetValue }} {{- if .Peer.Interface.DnsSearchStr.GetValue}}, {{ .Peer.Interface.DnsSearchStr.GetValue }} {{- end}}
 {{- end}}
 {{- if ne .Peer.Interface.Mtu.GetValue 0}}
 MTU = {{ .Peer.Interface.Mtu.GetValue }}
@@ -62,4 +62,4 @@ PresharedKey = {{ .Peer.PresharedKey }}
 {{- end}}
 {{- if and (ne .Peer.PersistentKeepalive.GetValue 0) (eq .Peer.Interface.Type "client")}}
 PersistentKeepalive = {{ .Peer.PersistentKeepalive.GetValue }}
-{{- end}}
\ No newline at end of file
+{{- end}}

@h44z
Copy link
Owner

h44z commented Mar 12, 2024

should be fixed now

@h44z h44z closed this as completed Mar 12, 2024
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

No branches or pull requests

4 participants