Originally Posted by piyush128k
I am trying to code a python script that does:- Using root account logs into multiple servers provided in a list. Check the OS type e.g. Linux, Solaris, HP-UX and Windows. Depending on the OS type it updates the name servers and options in /etc/resolv.conf. The update is done from a list that is also provided.
Any help is much appreciated.
Won't always work... It depends on the individual system.
If they are using DHCP, any changes made will be wiped out on next boot...
In the case of Linux, it depends on the distribution - RH/Fedora/CentOS/SL uses /etc/ifcfg-<ifname> files to initialize /etc/resolv.conf, and things may change depending on DHCP, number of interfaces... and it will again wipe out any changes you make.