Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

most-used-nslookup-commands

What is NSLOOKUP?

NSLOOKUP IS command line utility that is used for DNS queries and to lookup DNS Zone records i.e. to lookup IP address of a domain or reverse . 

If you are looking more details what is nslookup? Check the nslookup page on wikipedia.

Here are 10 widely used commands used to look up DNS zone records:

 

1. How to find the A record of а domain?

Command line:
$ nslookup example.com

2. How to check the NS records of a domain?

Command line:
$nslookup -type=ns example.com

 

3. How to query the SOA record of a domain?

Command line:
$nslookup -type=soa example.com

 

4. How to find the MX records responsible for the email exchange?

Command line:
$ nslookup -query=mx example.com

 

5. How to find all of the available DNS records of a domain?

Command line:
$ nslookup -type=any example.com

 

6. How to check a DNS record using of a specific DNS Server?

Command line:
$ nslookup example.com ns1.example.com

 

7. How to find the Reverse DNS Lookup (i.e. to resolve DNS record for an IP address) ?

Command line:
$ nslookup 8.8.8.8

 

8. How to change the DNS Server port number for the connection with DNS Server?

Command line:
$ nslookup -port=56 example.com

** if DNS server is listing on alternative port

9.How to set the timeout interval for a reply for DNS lookup query?

Command line:

$ nslookup -timeout=10 example.com

 

10. How to enable debug mode for DNS lookup query?

Debug mode provides important and detailed information both for the question and for the received answer.

Command line:
$ nslookup -debug example.com

 

 

Note:

Authoritative answer – This is the answer that originates from the DNS Server which has the information about the zone file.
Non-autoritative answer – When a nameserver is not in the list for the domain you did a lookup on.
DNS Default port – By default, the DNS servers use port 53.

 

How to Change Your Default Timezone in .htaccess (for hosting account)

 

 

You can change your hosting account time zone through .htaccess. By default this .htaccess file would be hidden text file under your hosting account. Please follow below instructions to edit / update .htaccess file to change DNS Zone:

Update timezone in .htacccess file using File Manager (cPanel hosting account)

  • Logon to your cPanel acccount >> File Manager
  •  if you not able to see .htaccess file, please click on Settings in File Manager and Select ‘Show Hidden Files’. Save it.
  • Select .htacccess file and click on Edit button
  • Type below lines and click on save button to save changes:

                  #Set default time zone for hosting account

         SetEnv TZ America/NewYork

  • 4: All is done.

How to change timezone in .htaccess through ssh / command shell

  • If you have access to SSH, please logon to your server with cPanel account
  • Edit .htacccess with your favorite shell editor , like nano or vi and save changes

    nano /home/yourcpaccount/public_html/.htaccess

How to Change Default Timezone in php.ini (custom php)

You can change your hosting account time zone for PHP applications through custom php.ini under your hosting account. You can place custom php.ini under root directory of your php application (for PHP 5.3 or latest versions). Please follow below instructions to edit / update .htaccess file to change DNS Zone:

 

Update timezone in custom php.ini file using File Manager (cPanel hosting account)

  • Logon to your cPanel acccount >> File Manager
  •  if you not able to see php.ini file, please click on Settings in File Manager and Select ‘Show Hidden Files’. Save it.
  • Select .htacccess file and click on Edit button
  • If there is no php.ini file listed, click on new file button in File Manager
  • Type below lines and click on save button to save changes:

                  #Set default time zone for PHP

        date.timezone = “US/Central”

  • 4: All is done.

You can see list of supported time zones here: http://www.php.net/manual/en/timezones.php

How to change timezone in php through ssh / command shell

  • If you have access to SSH, please logon to your server with cPanel account
  • Edit .htacccess with your favorite shell editor , like nano or vi and save changes

    nano /home/yourcpaccount/public_html/php.ini

How to block an IP(IP range) in CSF

You can block a single IP address or IP range from WHM interface or from the server bash/ SSH shell.

Block an IP from WHM:

    1. Log in to WHM as root.
    2. Navigate to Plugins section >> ConfigServer Security & Firewall 
    3. Explore for the Quick Deny section/button >> Enter the IP address or IP range in the red edit box that you willing to block. If you want, you can also add a comment in the next edit box.
    4. Click the Quick Deny button .
    5. The IP will be added to the CSF block list – /etc/csf/csf.deny file – and you will see a confirmation message:
    6. Click the Return button to return to the CSF main page.

 

Block an IP address / IP address range from server command line/ SSH:

  1. Log in to the server via SSH as root

Use the command: csf -d IP (replace IP with the IP address you willing to block , see examples below):

csf -d 11.22.33.44

You can also block IP blocks, like:

csf -d 11.22.33.0/24
csf -d 145.124.0.0/16


Or using your favorite editor edit /etc/csf/csf.deny directly to add IP addresses / IP ranges at once!


How to remove ipaddress block from new cphulk (through SSH on cPanel server)

It’s by design the IP addresses are unreadable in the database. The “Blacklist Management” tab in the cPHulk interface allows you to remove an IP address from the interface. You can also unblock an IP address from the iptables block out with a command such as:

Code:
/scripts/hulk-unban-ip IP-HERE

** Please change IP-HERE with IP address

You can find updated documentation on cPHulk at:

cPHulk Brute Force Detection

How To Upgrade to ubuntu16.04 LTS from ubuntu 14.04 LTS from SSH

This article will describe the steps to upgrade ubuntu 14.04 LTS to ubuntu 16.04 LTS from command line (SSH/ or server cosnole)

Precaution:

  • Don’t attempt upgrade for system with RAM below 1GB, Attempting to upgrade a server with less than 1GB of RAM may result in database corruption.
  • Please take snapshot of your server before you start upgrade process.
  • All of apps and services will be down during upgrade process.
  • Upgrade process would take few minutes to several hours, all depends on your server network connection speed and server hardware.

Preparation to upgrade:

SSH to your server as root and run below command to make sure your server is ready to upgrade, if you see error messages or any command fails, don’t start upgrade process:

sudo apt-get update && sudo apt-get dist-upgrade
sudo dpkg --configure -a

If you don’t see any error messages by executing above commands, you are ready to upgrade your server, follow commands as below:

sudo do-release-upgrade -f DistUpgradeViewNonInteractive

At the completion of upgrade process you would see prompt to remove obsolete packages, just enter ‘y’ after this upgrade process is complete .

Restart your server

sudo init 6

Now your server is upgraded to latest release.

Once upgrade complete and server successfully booted with new OS, be advised to create new snapshot of your server.

If your upgrade fails due to any reason you can restore from snapshot of old release that you generated before to start your OS upgrade process.

Ubuntu 16.04 release notes: https://wiki.ubuntu.com/XenialXerus/ReleaseNotes