Monthly Archives: June 2017

How to flush the DNS cache

After you change the nameservers for your site, you will want to clear the DNS cache.

Notice that clearing the Windows OS/Chrome cache after you’ve changed the nameservers for your site, doesn’t guarantee that your site will load from the new server. You will need to wait for the new nameservers to propagate to the nodes near your location.

For Windows OS:

Search Windows for “cmd” (Command Prompt). In the Command Prompt window, type ipconfig /flushdns

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\Max>ipconfig /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

C:\Users\Max>
Windows Command Prompt
Windows Command Prompt

If you are using a recent version of Windows – like Windows 10 – you can also use the Windows PowerShell. Use the same command ipconfig /flusdns :

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\Max> ipconfig /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.
PS C:\Users\Max>
Windows PowerShell
Windows PowerShell

Some browsers keep a DNS cache which is independent from the one used by the OS. For example, in Google Chrome, navigate to chrome://net-internals/#dns and click the “Clear host cache” button.

Google Chrome Clear host cache
Google Chrome Clear host cache

You can also clear the DNS cache for your domain at the Google Flush Cache

Share this post:

We have reached 100 posts :)

We are very happy ūüôā We’ve reached 100 posts on our blog/knowledge base.¬†

Please continue to send your comments/requests for new articles. We need your feedback.
Thank you all!

Contact us via:
Email: https://www.plothost.com/contact/
Facebook: https://www.facebook.com/plothost/
Twitter: https://twitter.com/plothost
YouTube Channel:  https://www.youtube.com/

Share this post:

Installing Perl Modules in cPanel

Perl Modules are in fact libraries of functions that will help you in your source code. 
By default, the module include path is:

/home/username/perl

To let Perl know how to find the modules, use at the beginning of your script:

#!/usr/bin/perl
use cPanelUserConfig;

or

#!/usr/bin/perlml

The Perl system modules installed by cPanel are listed below. You can manually install the Perl modules that you want.

System Perl Modules
CPAN
CPAN::Meta::Requirements
CPAN::Meta::YAML
Crypt::PasswdMD5
DBD::mysql
DBI
Digest::MD5
Digest::SHA1
Expect
ExtUtils::MakeMaker
GnuPG
IO::Tty
LWP
LWP::Protocol::https
Mozilla::CA
Net::HTTP
Regexp::Assemble
Test::Pod
Test::Simple
Try::Tiny
URI
local::lib
version

To install a Perl Module in cPanel:

  1. Log into the cPanel account
  2. Locate Perl Modules in the SOFTWARE section
  3. If you know the exact module name that you want to install, just type its name in the Install a Perl Module edit box and click the Install Now button.
  4. If you don’t know the exact module name click the Show Available Modules, look for the desired module, and click the Install link.
  5. Click the Go Back button
  6. You will see the installed modules in the Installed Perl Module(s) section. 

From the Installed Perl Module(s) section, you can Update, Reinstall, Uninstall and view the docs for each module.

Contact your host if you are getting error messages while installing Perl modules.
Some modules have dependencies, so other modules may be installed with your desired module.

Video tutorial for installing a Perl Module Рin this case the String::Diff module:

If you have SSH access you can use perl -v and instmodsh commands for more information.
Examples:

root@web [~]# perl -v

This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 34 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

root@web [~]# instmodsh
Available commands are:
   l            - List all installed modules
   m    - Select a module
   q            - Quit the program
cmd? l
Installed modules are:
   CPAN
   CPAN::Meta::Requirements
   CPAN::Meta::YAML
   Crypt::PasswdMD5
   DBD::mysql
   DBI
   Digest::MD5
   Digest::SHA1
   Expect
   ExtUtils::MakeMaker
   GnuPG
   IO::Tty
   LWP
   LWP::Protocol::https
   Mozilla::CA
   Net::HTTP
   Perl
   Regexp::Assemble
   Test::Pod
   Test::Simple
   Try::Tiny
   URI
   local::lib
   version
cmd? q
root@web [~]#
Share this post:

How to add DKIM and SPF records for your domain from cPanel

DKIM and SPF are two mechanism that allow you to prevent SPAM email messages. Also, they will improve your email delivery rates. You can easily enable them in cPanel.

DKIM is a means of verifying incoming email. It ensures that incoming messages are unmodified and are from the sender from whom they claim to be. This feature works to prevent incoming spam messages.

 

The SPF system allows you to specify servers and IP addresses that are authorized to send mail from your domain(s). This feature works to prevent outgoing spam messages.

 

cPanel DKIM SPF cPanel DKIM SPF

To enable DKIM and/or SPF in cPanel:

  1. Go to yourdomain.com/cpanel and log in
  2. Navigate to EMAIL section, look for Authentication option
  3. On the DKIM section click the Enable button. You will see a confirmation: DKIM has been enabled.
    The DKIM record will look like:

    default._domainkey IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtNG7H+7jKR5uZT/RD7nGbVQk9Pv7PrP279MQ7rEAhq0CRUiXTBh7LSfkeLoEHwjSiFrs0hVXR4sDD7iiDn08BTNfSvH2GaS0Vnz83qeJAAf3nkB1KjrIwqYOD1+Wl+GtDdzCx6/1OFcckRQsN8I3N+hH41sbf5ouVf3O9IANvSpzq6IWWvDqpmncIwebJkt8r" agdAyTNRjpcNHJjlIc9pAMnNz1lMoaaf61kRt3quxkdbnYwVxtvprkWdbyjMJ+zJ7lpwOCBYBAW9HVoM3S5/vUWUA0RB6o3V96qs4edRh7spuMi/aLvygKs7Agsbz5LPajybl5gqqhUYumUnyMOcwIDAQAB\;
  4. Click the Go Back button
  5. On the SPF section click the Enable button. You will see a confirmation like: SPF has been enabled. Your raw SPF record is: v=spf1 +a +mx +ip4:192.255.1.1 ~all
  6. Click the Go Back button
  7. ¬†You can also change other advanced settings. Modify them only as you know what are you doing. Otherwise, don’t modify these settings or ask your host about them.
  8. This is all. You have configured DKIM and SPF for your domain.

You can check the DNS entries which has been added in cPanel->DOMAINS section->Zone Editor.

The video tutorial for this knowledge base post:

Related KB post:
Add a DMARC record to your domain in cPanel

Share this post:

How to run cPanel accounts backup from SSH

It’s always a good idea to make on-site/off-site backups of your cPanel accounts. WHM will automatically make backups as per settings from WHM->Backup->Backup Configuration. But you can also run the backup process from the command line.

To start the backup, run:

/usr/local/cpanel/bin/backup

and to force it, run:

/usr/local/cpanel/bin/backup --force

Notice that if backups are not enabled in WHM you can’t start the backup process with the first command:

root@web [~]# /usr/local/cpanel/bin/backup
[2017-05-30 13:13:11 -0400] info [backup] Started at Tue May 30 13:13:11 2017
[2017-05-30 13:13:11 -0400] info [backup] Backups are not scheduled to run today. This can be adjusted in WHM => Backup => Backup Configuration or by calling bin/backup with the --force argument.

You will need to use the –force argument:

root@web [~]# /usr/local/cpanel/bin/backup --force
[2017-05-30 13:15:21 -0400] info [backup] Started at Tue May 30 13:15:21 2017
[2017-05-30 13:15:22 -0400] info [backup] The backup is now running in the background in process 16608.
[2017-05-30 13:15:22 -0400] info [backup] The backup process’s log file is "/usr/local/cpanel/logs/cpbackup/1496164521.log".
Don’t forget to select the users for which you will run the backup. Select them in WHM->Backup->Backup User Selection

For some time you can also use the old backup (legacy) system. Notice that it will be removed in the next cPanel versions – probably in v66. To start the old backup process:

/scripts/cpbackup

and to force the legacy backup to start, use:

/usr/local/cpanel/scripts/cpbackup --force
You will use the –force parameter if the backup is up to date but you still want to run it for any reason.
Share this post:
Page 11 of 11
1 9 10 11