From 4972c5cdc1231ea7bed7e1e1b8b1d207a8361136 Mon Sep 17 00:00:00 2001 From: sjing Date: Tue, 24 May 2011 07:58:22 +0000 Subject: [PATCH] Support the /etc/hosts name resolution. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9667 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/dhcp.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index fb606a81a..73364969d 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1658,9 +1658,9 @@ sub addnet } elsif ($myip){ push @netent, " option ntp-servers $myip;\n"; } - push @netent, " option domain-name \"$domain\";\n"; if ($nameservers) { + push @netent, " option domain-name \"$domain\";\n"; push @netent, " option domain-name-servers $nameservers;\n"; } my $ddnserver = $nameservers; @@ -1676,11 +1676,17 @@ sub addnet } else { push @netent, " zone $domain. {\n"; } - push @netent, " primary $ddnserver; key xcat_key; \n"; + if ($ddnserver) + { + push @netent, " primary $ddnserver; key xcat_key; \n"; + } push @netent, " }\n"; foreach (getzonesfornet($net,$mask)) { push @netent, "zone $_ {\n"; - push @netent, " primary $ddnserver; key xcat_key; \n"; + if ($ddnserver) + { + push @netent, " primary $ddnserver; key xcat_key; \n"; + } push @netent, " }\n"; } }