Command Line Network Configuration 11SP3`

I need to script the network configuration for an SLES11 SP3 VM build.

The only issue I am having is I am able to edit the /etc/resolv.conf and have the proper search Domain parameters added but in Yast I know they are not reflected. I found the yast edit dns nameserver options for the command line but I have not been able to discover something that would work for adding or updating the domain search option(s).

Thank you for your assistance in this matter and make it a great day.

Steven A. Robertson

How about setting the NETCONFIG_DNS_STATIC_SERVERS value in the
/etc/sysconfig/network/config file as a space-delimited list of values.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

[QUOTE=ab;27144]How about setting the NETCONFIG_DNS_STATIC_SERVERS value in the
/etc/sysconfig/network/config file as a space-delimited list of values.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…[/QUOTE]

That works perfectly! Thank you. I can use grep to get the line number for the edit in the file and then update it accordingly.

Thank you once again.

[QUOTE=StevenR77;27145]That works perfectly! Thank you. I can use grep to get the line number for the edit in the file and then update it accordingly.
[/QUOTE]

Why use grep to get the line number before editing the file?

mike@minimac:/tmp> cp /etc/sysconfig/network/config . mike@minimac:/tmp> grep ^NETCONFIG_DNS_STATIC_SERVERS config NETCONFIG_DNS_STATIC_SERVERS="" mike@minimac:/tmp> sed -i 's/^\\(NETCONFIG_DNS_STATIC_SERVERS="\\).*/\\1123.123.123.123 456.456.456.456"/' config mike@minimac:/tmp> grep ^NETCONFIG_DNS_STATIC_SERVERS config NETCONFIG_DNS_STATIC_SERVERS="123.123.123.123 456.456.456.456" mike@minimac:/tmp>

[QUOTE=StevenR77;27145]That works perfectly! Thank you. I can use grep to get the line number for the edit in the file and then update it accordingly.
[/QUOTE]
I recommend to have a look at ansible.