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-09-15 10:33:29.000000000 -0400
+++ NetworkManager-0.7.0/src/named-manager/nm-named-manager.c 2008-10-12 08:25:48.000000000 -0400
@@ -243,7 +243,7 @@ write_resolv_conf (FILE *f, const char *
g_free (tmp_str);
}
- if (nameservers) {
+ if (nameservers && g_strv_length (nameservers)) {
GString *str;
int num;
@@ -265,6 +265,14 @@ write_resolv_conf (FILE *f, const char *
}
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",