# Command Line Network Configuration 11SP3\`

**URL:** <https://forums.suse.com/t/command-line-network-configuration-11sp3/26864>\
**Category:** SLES Configure-Administer\
**Created:** [March 25, 2015, 10:17pm UTC](https://forums.suse.com/t/command-line-network-configuration-11sp3/26864 "2015-03-25T22:17:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![StevenR77](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@StevenR77](https://forums.suse.com/u/StevenR77)\
**Post date:** [March 25, 2015, 10:17pm UTC](https://forums.suse.com/t/command-line-network-configuration-11sp3/26864/1 "2015-03-25T22:17:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [March 25, 2015, 11:24pm UTC](https://forums.suse.com/t/command-line-network-configuration-11sp3/26864/2 "2015-03-25T23:24:21Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![StevenR77](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@StevenR77](https://forums.suse.com/u/StevenR77)\
**Post date:** [March 25, 2015, 11:38pm UTC](https://forums.suse.com/t/command-line-network-configuration-11sp3/26864/3 "2015-03-25T23:38:21Z")

</div>

[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.

---

<div class="post-metadata">

**Author:** ![mikewillis](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@mikewillis](https://forums.suse.com/u/mikewillis)\
**Post date:** [March 25, 2015, 11:57pm UTC](https://forums.suse.com/t/command-line-network-configuration-11sp3/26864/4 "2015-03-25T23:57:09Z")

</div>

[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> 
`

---

<div class="post-metadata">

**Author:** ![MoserHans](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@MoserHans](https://forums.suse.com/u/MoserHans)\
**Post date:** [April 2, 2015, 1:05pm UTC](https://forums.suse.com/t/command-line-network-configuration-11sp3/26864/5 "2015-04-02T13:05:44Z")

</div>

[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](http://docs.ansible.com/).
