×

This article covers how to query various DNS records. The dig command in Linux is used to gather DNS information. It stands for Domain Information Groper, and it collects data about Domain Name Servers. The dig command is helpful for diagnosing DNS problems, but is also used to display DNS information.

By default, dig sends the DNS query to name servers listed in the resolver(/etc/resolv.conf) unless it is asked to query a specific name server.


How to Install Dig on Linux ?

1. On Debian and Ubuntu, run:

$ apt-get install dnsutils

2. On CentOS 7, run the command:

$ yum install bind-utils

3. Once installed, check the version, to make sure the setup was completed successfully:

$ dig -v


Dig Syntax

In its simplest form, the syntax of the dig utility will look like this:

dig [server] [name] [type]


i. [server] – the IP address or hostname of the name server to query.

If the server argument is the hostname then dig will resolve the hostname before proceeding with querying the name server.

It is optional and if you don't provide a server argument then dig uses the name server listed in /etc/resolv.conf.

ii. [name] – the name of the resource record that is to be looked up.

iii. [type] – the type of query requested by dig. For example, it can be an A record, MX record, SOA record or any other types.

By default dig performs a lookup for an A record if no type argument is specified.



This article covers how to install and configure the Unbound name resolution server in Ubuntu with basic configuration. Unbound is basically a recursive-only caching DNS server which can perform DNSSEC validation of results. Unbound is the best alternative for setting up a caching nameserver on your LAN or personal machine.


To install Unbound from official Repository, run the following commands:

$ sudo apt update
$ sudo apt install unbound -y



This article covers how to flush the DNS cache on Ubuntu. If the sites are not loading properly or you are receiving outdated sites, try to flush the DNS cache to see if the issue resolves. 

Remember, after the DNS cache is flushed, sites will first load slightly slower. 

But once the DNS cache is re-populated, sites will be loaded faster.


Facts about flushing DNS cache on Ubuntu:

1. DNS cache is a temporary database that stores information about previous DNS lookups. 

2. Whenever you visit a website, your OS and web browser will keep a record for the domain and the corresponding IP address. 

3. Flushing DNS cache eliminates the need for repetitive queries to the remote DNS servers and allows your OS or browser to resolve the website's URL quickly.


How to use dns-clean to flush DNS-Cache ?

You can clear the DNS cache is by starting the dns-clean utility. Run the following command in your Terminal to do so:

$ sudo /etc/init.d/dns-clean start



This tutorial will guide you on how to get Nginx server installed and configured on an Ubuntu Linux 18.04 LTS server.

Nginx is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet. It is more resource-friendly than Apache in most cases and can be used as a web server or reverse proxy.


Nginx Configuration Files Structure

  • All configuration files are located in the /etc/nginx/ directory.
  • Nginx main configuration file is at /etc/nginx/nginx.conf.
  • It's best practice to create a separate configuration file of each domain for better maintainability.
  • New server blocks (configuration file) of each domain should be stored in /etc/nginx/sites-availabledirectory. You need to make symlink of these configuration files at /etc/nginx/sites-enabled to take in used by Nginx.
  • Activating server blocks is done by creating a symlink (a pointer) from the configuration file sites in a /etc/nginx/sites-enabled directory to the sites-enabled directory.
  • The default server web root directory is /var/www/html
  • It's best practice to to follow standard naming convention. Nginx server block files name should as domain name and must end with .conf extension. For example, your domain name is example.com then server block file name should example.com.conf
  • Nginx log files (access.log and error.log) are located in the /var/log/nginx/ directory. It's also recommended to have a different access and error log files for each server block.



This article will help you to get Pi-hole installed and to configure it Debian or Ubuntu Linux along with an OpenVPN server.



Here is a complete guide on how to configure the DNS caching-only server on CentOS 8.



Here, you will learn how to install and configure a DNS Server on CentOS 8 machine.



This article will guide you on how to configure a Static IP address on CentOS 8.




More Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on IbmiMedia.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com