I have a line in the scripted install that uses:
network --bootproto static --ip x.x.x.x --netmask 255.255.255.0 --gateway x.x.x.x --nameserver x.x.x.x
To set the primary DNS server of the ESX. Is there an extra switch to allow me to set the alternate dns server as well?
If there isn't, can I put another line in the post install process to add it in? Thanks.
This will rewrite the file completely...
echo "search network.com" > /etc/resolve.conf
echo "nameserver 202.54.1.10" >> /etc/resolve.conf
echo "nameserver 202.54.1.11" >> /etc/resolve.conf
If you just want to add to it then always use >>
when you use > it overwrites the file
Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
*Virtualization is a journey, not a project.*
All networking information must be on one line, so only one DNS server may be specified.
The file that has the DNS info is /etc/resolv.conf so you can echo the info and pipe to that file in the %post
Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
*Virtualization is a journey, not a project.*
Hi Steve,
Yup, I found the file while waiting for a response but do you know how I can add an extra line after the primary name server?
I was thinking about using the sed command to search and replace but I don't know what the line break symbol is. I was thinking something like:
sed -i.bak -e "s/nameserver 10.0.0.50 nameserver 10.0.0.50 LINE BREAK nameserver 10.0.0.51/g'
..or if there's an easier way to do it? Thanks. Last piece before I try the scripted install again.
This will rewrite the file completely...
echo "search network.com" > /etc/resolve.conf
echo "nameserver 202.54.1.10" >> /etc/resolve.conf
echo "nameserver 202.54.1.11" >> /etc/resolve.conf
If you just want to add to it then always use >>
when you use > it overwrites the file
Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
*Virtualization is a journey, not a project.*
Thank you for your continuing help Steve! Worked like a charm. No onwards to test this script out!