Python Script to detect OS and update name server and options in resolve.conf on mult
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Python Script to detect OS and update name server and options in resolve.conf on mult
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.
Thanks for your questions...no help from that. The answer to a question is not a question but guidance in the form of an answer.
I got things moving on and i should be fine. I have been reading books and researching on the web a lot though i am no where near to finishing it but am moving ahead gradually.
The answer to a question is not a question but guidance in the form of an answer.
I beg to differ. our questions are guidance in the form of show us what you have tried as opposed to tell me the answer which is what you presented initially.
Without any examples or effort on your behalf you will find little that we can do for you as no one here will tell you the answer.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.