[DEBUG] Linux resolve error ‘chmod: changing permissions of ‘resolv.conf’: Operation not permitted’

Error Code:

# chmod 644 resolv.conf
chmod: changing permissions of 'resolv.conf': Operation not permitted

Analysis:

This file is locked by chattr command

Solution:

Step One: Cancel the lock

# chattr -i /etc/resolv.conf

Step Two: Change the file’s privilege

# chmod 644 resolv.conf

Step Three: Relock this file

# chattr +i /etc/resolv.conf