How to Change DNS Config in Checkpoint Console

Changing DNS settings through the CLI or console in Checkpiont is a straightforward process, and in this blog post, we’ll guide you through the steps to accomplish this task effectively. The process is usefull when you lock yourself out because “out of date” DNS configurations.

  1. Log in to the Expert mode.
  2. Backup the current /etc/resolv.conf file:

[Expert@HostName:0]# cp -v /etc/resolv.conf /etc/resolv.bak

  1. Edit the current /etc/resolv.conf file (manual page: https://linux.die.net/man/5/resolv.conf): Update the DNS config to be the correct ones

[Expert@HostName:0]# vi /etc/resolv.conf

  1. Save the changes and exit from Vi editor.
  2. Write-protect the /etc/resolv.conf file from being overwritten by Gaia OS daemon (confd):

Add the Linux file system ‘immutable‘ attribute using the chattr command (verify using the lsattr command):

[Expert@HostName:0]# lsattr /etc/resolv.conf
[Expert@HostName:0]# chattr +i /etc/resolv.conf
[Expert@HostName:0]# lsattr /etc/resolv.conf

  1. If any changes in DNS configuration are made in Gaia Clish / Gaia Portal after write-protecting the /etc/resolv.conf file, they will not be saved in this file – these changes will be saved only in Gaia database. This will result in inconsistency between the real DNS configuration in the /etc/resolv.conf file and the DNS configuration in Gaia database.
  2. Once DNS Config is updated, now you can remove the write-protection, remove the Linux file system ‘immutable‘ attribute:

[Expert@HostName:0]# lsattr /etc/resolv.conf
[Expert@HostName:0]# chattr -i /etc/resolv.conf

Leave a Comment

Your email address will not be published. Required fields are marked *