How to find and replace resolv.conf name server ip address with sed command?
Posted by chandu on December 12th 2017 08:49 AM
The /etc/resolv.conf file is used for DNS client server, to determine both master and slave servers. If you want to replace resolv.conf name server ip address by using sed command. Use the following command to replace name server ip address: Syntax: # sed -i -- 's/oldip/newip/g' /etc/resolv.conf The -i option is used to edit the /etc/resolv.conf the “g” at the end tells sed to perform the action globally. The -- serves to tell sed .This is useful to protect against file names starting with -. Fisrt check the resolv.conf file to know name server ip address by using following command: