What is the best approach for developing a program in python that can replace an old DNS Server address for a new one in Ubuntu 12.04?
UPDATE: Basically what I need is a way to update my resolv.conf file content so that I can replace the nameservers configured in there.
So for example I have in my resolv.conf:
nameserver 10.0.0.1
nameserver 10.0.0.2
And I need to somehow modify to have the values:
nameserver 10.0.0.3
nameserver 10.0.0.4
I need to make this using python(or any scripting language or even by command line), because I need to do this in a user-friendly window that must run in a kiosk-mode Xubuntu.
**NOTE:
So far I have tried finding an ubuntu command that can achieve this, but I haven't found one.
I have also tried modifying /etc/resolv.conf but Python has no ability to modify a file, so I need to delete the file and create the file with the new content, however I have no permission to do this (already tried chmod 777 and chattr -a but they didn't work)