The file that actually handles WHM > DNS Functions > Nameserver IPs area is at /var/cpanel/nameserverips.yaml location.
If you want this to be changed, you’d want to make a backup of that file first and then modify it:
cd /var/cpanel cp nameserverips.yaml nameserverips.yaml.back nano nameserverips.yaml