File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ func Setup(opts *SetupOptions) error {
4747 NoTCPNamespacePorts := true
4848 NoUDPNamespacePorts := true
4949 NoMapGW := true
50+ NoDNS := true
5051
5152 path , err := opts .Config .FindHelperBinary (BinaryName , true )
5253 if err != nil {
@@ -102,6 +103,8 @@ func Setup(opts *SetupOptions) error {
102103 NoMapGW = false
103104 // not an actual pasta(1) option
104105 cmdArgs = append (cmdArgs [:i ], cmdArgs [i + 1 :]... )
106+ case "-D" , "--dns" , "--dns-forward" :
107+ NoDNS = false
105108 }
106109 }
107110
@@ -120,6 +123,12 @@ func Setup(opts *SetupOptions) error {
120123 if NoMapGW {
121124 cmdArgs = append (cmdArgs , "--no-map-gw" )
122125 }
126+ if NoDNS {
127+ // disable pasta reading from /etc/resolv.conf which hides the
128+ // "Couldn't get any nameserver address" warning when only
129+ // localhost resolvers are configured.
130+ cmdArgs = append (cmdArgs , "--dns" , "none" )
131+ }
123132
124133 // always pass --quiet to silence the info output from pasta
125134 cmdArgs = append (cmdArgs , "--quiet" , "--netns" , opts .Netns )
You can’t perform that action at this time.
0 commit comments