/etc/resolv.conf not able to edit in Linux as the Root user
Error: Try to open the /etc/resolv.conf file from the root user but it’s open as read only file.
Solution:
- Check the attribute of /etc/resolv.conf file
[root@rac1 grd]$ lsattr /etc/resolv.conf
----ia------------ /etc/resolv.conf
2. Change or remove this Ia attribute from /etc/resolv.conf
[root@rac1 grd]$ chattr -a /etc/resolv.conf
[root@rac1 grd]$ chattr -i /etc/resolv.conf
3. Check again with /etc/resolv.conf file
[root@rac1 grd]$ lsattr /etc/resolv.conf
------------------ /etc/resolv.conf
4. Now try to open with vi or gedit editor will fix the read-only issue.
[root@rac1 grd]$ vi /etc/resolv.conf