diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index d7f6b16..c42d933 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -4160,6 +4160,53 @@
     if (success)
     {
         dns_options_postprocess_pull(&o->dns_options);
+
+#if defined(_WIN32) || defined(TARGET_ANDROID)
+        /* If there's --dns servers, remove dns related --dhcp-options */
+        if (o->dns_options.servers)
+        {
+            o->tuntap_options.dns_len = 0;
+            o->tuntap_options.dns6_len = 0;
+            o->tuntap_options.domain = NULL;
+            o->tuntap_options.domain_search_list_len = 0;
+        }
+#else  /* if defined(_WIN32) || defined(TARGET_ANDROID) */
+        /* Clean up env from overridden DNS config */
+        struct gc_arena gc = gc_new();
+        struct buffer name = alloc_buf_gc(OPTION_PARM_SIZE, &gc);
+        struct buffer value = alloc_buf_gc(OPTION_PARM_SIZE, &gc);
+
+        const int fo_count = o->foreign_option_index;
+        o->foreign_option_index = 0;
+
+        for (int i = 1; i <= fo_count; ++i)
+        {
+            buf_clear(&name);
+            buf_printf(&name, "foreign_option_%d", i);
+            const char *env_str = env_set_get(es, BSTR(&name));
+            const char *item_val = strchr(env_str, '=') + 1;
+            buf_clear(&value);
+            buf_printf(&value, "%s", item_val);
+
+            /* Remove foreign option item from env set */
+            env_set_del(es, BSTR(&name));
+
+            item_val = BSTR(&value);
+            if (strncmp(item_val, "dhcp-option ", 12) != 0
+                || (strncmp(item_val + 12, "ADAPTER-DOMAIN-SUFFIX ", 22) != 0
+                    && strncmp(item_val + 12, "DOMAIN-SEARCH ", 14) != 0
+                    && strncmp(item_val + 12, "DOMAIN ", 7) != 0
+                    && strncmp(item_val + 12, "DNS6 ", 5) != 0
+                    && strncmp(item_val + 12, "DNS ", 4) != 0))
+            {
+                /* Re-set the item with potentially updated name */
+                buf_clear(&name);
+                buf_printf(&name, "foreign_option_%d", ++o->foreign_option_index);
+                setenv_str(es, BSTR(&name), BSTR(&value));
+            }
+        }
+        gc_free(&gc);
+#endif /* defined(_WIN32) || defined(TARGET_ANDROID) */
     }
     return success;
 }
