NetworkManager/explain-dns1-dns2.patch

22 lines
1.1 KiB
Diff
Raw Normal View History

2008-04-30 19:43:19 +00:00
diff -up NetworkManager-0.7.0/src/named-manager/nm-named-manager.c.foo NetworkManager-0.7.0/src/named-manager/nm-named-manager.c
--- NetworkManager-0.7.0/src/named-manager/nm-named-manager.c.foo 2008-04-29 23:19:22.000000000 -0400
+++ NetworkManager-0.7.0/src/named-manager/nm-named-manager.c 2008-04-29 23:25:10.000000000 -0400
@@ -385,6 +385,17 @@ rewrite_resolv_conf (NMNamedManager *mgr
/* Using glibc resolver */
char *nameservers = compute_nameservers (composite);
+ if (!nameservers || !strlen (nameservers)) {
+ g_free (nameservers);
+ nameservers = g_strdup_printf ("\n\n%s%s%s%s%s%s",
+ "# No nameservers found; try putting DNS servers into your\n",
+ "# ifcfg files in /etc/sysconfig/network-scripts like so:\n",
+ "#\n",
+ "# DNS1=xxx.xxx.xxx.xxx\n",
+ "# DNS2=xxx.xxx.xxx.xxx\n",
+ "# SEARCH=lab.foo.com bar.foo.com\n");
+ }
+
if (fprintf (f, "%s%s%s\n",
domain ? domain : "",
searches ? searches : "",