NetworkManager/explain-dns1-dns2.patch

28 lines
1.2 KiB
Diff
Raw Normal View History

diff -up NetworkManager-0.7.0/src/named-manager/nm-named-manager.c.explain-dns1-dns2 NetworkManager-0.7.0/src/named-manager/nm-named-manager.c
--- NetworkManager-0.7.0/src/named-manager/nm-named-manager.c.explain-dns1-dns2 2008-08-27 13:20:27.000000000 -0400
+++ NetworkManager-0.7.0/src/named-manager/nm-named-manager.c 2008-08-27 16:02:31.000000000 -0400
@@ -236,7 +236,7 @@ update_resolv_conf (const char *iface,
g_free (tmp_str);
}
- if (nameservers) {
+ if (nameservers && g_strv_length (nameservers)) {
GString *str;
int num;
int i;
@@ -259,6 +259,14 @@ update_resolv_conf (const char *iface,
}
nameservers_str = g_string_free (str, FALSE);
+ } else {
+ nameservers_str = 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",
+ "# DOMAIN=lab.foo.com bar.foo.com\n");
}
2008-04-30 19:43:19 +00:00
if (fprintf (f, "%s%s%s\n",