DNS Info

From TheBestLinux.com
Jump to navigation Jump to search

DNS - Domain Name Server

DNS is a system used to find computers on the internet and in private networks. The most common DNS server is the UNIX/Linux BIND8 & BIND9 NAMED(Named Daemon) package. Microsoft and other companies also make their own proprietary DNS server packages as well.

Query DNS Server Records - Find an IP address or hostname

There are a number of tools which can be used to query information from DNS servers. The two most common command-line DNS tools are DIG and NSLOOKUP.

DIG

Dig is a simple command used to query DNS server records, either by supplying the FQDN(Fully Qualified Domain Name - such as "www.dawgland.com", into a numeric IP address, such as "73.42.198.249". This basic main IP address is known as a type A DNS server record, as it's IP version 4, which consists of 4 numbers separatedd by 3 dots. Less used currently are IPv6(IP version 6) records, known as AAAA DNS server records. Other DNS server record types are CN, which stands for "Common Name", which are aliases to actual hostnames, such as "mail" pointing to the IP address of the hostname "mail.domainname.com", and MX records,used to indicate actual email servers.

Here are some examples of how to use the dig command: Query a standard A hostname DNS record:

[jamie@server.dawgland.com:~]$ dig A jrcomputers.net +short
213.255.247.82
[jamie@server.dawgland.com:~]$



Query an Email Server's DNS record:

[jamie@server.dawgland.com:~]$ dig MX jrcomputers.net +short
0 mail.jrcomputers.net.
[jamie@server.dawgland.com:~]$



Perform a Reverse-DNS(rDNS) query/lookup:

[jamie@server.dawgland.com:~]$ dig -x 213.255.247.82 +short
mail.jrcomputers.net.
[jamie@server.dawgland.com:~]$



Email DNS MX Record Setup Example Using RCModelHelis.com DNS Info for GoDaddy.com DNS Server Setup Configuration

Steps to setup the Email MX DNS record allowing mail to flow to the server: (Using My New VM Host vm1.rcmodelhelis.com)

For all 3 steps below, set TTL(Time To Live) to 600 seconds
and DO NOT include the quotes in the examples:

  • Create DNS "A" Redord "vm1" which points to IP "198.56.248.58"
  • Create DNS "CName" Alias Redord "mail" which points to "vm1.rcmodelhelis.com"
  • Create DNS "MX" Record "@" which points to "mail.rcmodelhelis.com" with Highest Priority set to "0" (Lower number = higher priority)

    Save all DNS redords for changes to take effect, which is usually instant from past experience with the above examples. Others may take longer.

    Check and test your MX record setup/configuration from the command line on your new email server:
    dig +short A $(dig +short MX rcmodelhelis.com | head -1 | cut -d' ' -f2)
    


    Or:

    [jamie@fc36.dawgland.com:~]$ host -t MX linuxjamie.com
    linuxjamie.com mail is handled by 0 linuxjamie-com.mail.protection.outlook.com.
    


    If the result of this command is the IP address of your server, you are good to go!.
    If it is not, check the MX records of your domain DNS zone. Also, be sure you have waited long enough for the changes to spread through the internet.
    This can take up to 24 hours. Also make sure your /etc/resolv.conf file is listing valid DNS servers.