Recently I needed to verify my domain with Google’s Firestore to allow custom domain on emails sent by the app. I headed to the cPanel to update the TXT and CNAME records as instructed by Google. That is where I encountered an issue Failed to validate args in method GAP::Dns::record_update. A quick internet search proved futile with many having the same issue and hosting companies providing generic answers or telling users to talk to their tech support. The problem is, most tech support response was that it is not possible to do so.
While tinkering with different settings, I accidentaly came across a fairly easy solution. This will only work if you have access to a WebHost Manager (WHM) account. Usually if you have a VPS package with your hosting and can be accessed on port 2086 of your domain (example.com:2086).
- Login to your cPanel and navigate to the domain’s DNS editor.
- Enter the host record but remove any underscores in the field “Points To:” then click “add record”. The record should save successfully.
Login to your WHM and navigate to “edit DNS Zone” - Select the domain you are working on and click “edit”
- Scroll down to the record you just entered in cPanel DNS editor and overwrite the “Points To: ” record with the correct one including the underscores.
- Save and go back to cPanel and reload to verify that the settings updated
Update zones via SSH
If you have VPS hosting or root access to your server, you can use the following steps to update the zone configurations.
- Login to your account using SSH terminal as root
- Your zone configurations are located in `/var/named` Enter command `cd /var/name $$ ls`
>This will navigate to the /var/named directory and list files. - Edit the zone for the domain you want from the list of domain names ending with `.com.db` using nano or vim For example `nano johnmuchiri.com.db`
- Enter the CNAME or TXT entry as needed on the bottom of the file. For example
johnmuchiri.com. 14400 IN TXT firebase=myapp
firebase1._domainkey 14400 IN CNAME mail-myapp-com.dkim1._domainkey.firebasemail.com.
firebase2._domainkey 14400 IN CNAME mail-myapp-com.dkim2._domainkey.firebasemail.com.
Include the trailing dots as shown in TXT and CNAME
Save the file and reboot server or use rndc command instead of rebooting the server `rndc reload `
>DNS changes can take up to 4 hours for propagation but in most cases, I have seen the changes take only 10 – 20 minutes.