habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Checking FQDN, MX record, Reverse-DNS/PTR

2 min read

Checking FQDN, Reverse-DNS-PTR, MX record

Fully qualified domain name verifikasi FQDN, reverse PTR, MX record. This is easy method checking FQDN mx record and PTR.

Before starting the mail server setup, some things to pay attention to are FQDN verification, PTR recovery, MX records.

FQDN

FQDN (fully qualified domain name) is a name assigned to an individual machine. Its purpose is to uniquely identify a single machine across internet. It is name of your server.

Checking Hostname (FQDN)

Following commands show outcome for test.rtcamp.com (a subdomain we used for test mail server setup)

Check FQDN by running following command on server:

hostname -f

Outputs:

dev-srv.habibza.in

Changing Hostname (FQDN)

If its incorrect, or need a change you can do so by running:

hostname myhost.mydomain.mytld

As you can see, we can give any name to your server, you may be wondering how uniqueness works! That’s where reverse PTR come into picture.

Important – Set “A” Record for Host in FQDN

If you set your machine’s FQDN, for example mail.example.com, then at example.com DNS create an “A” record for subdomain “mail” pointing to your server’s IP address.

You can use example.com as your hostname also which most likely pointing to your server’s IP address already. It’s not FQDN technically, but I see it working mostly. Still, I will never use or recommend non-FQDN hostname.

Reverse DNS/PTR Record

Like “A” record help global internet find IP-address for a domain, pointer record (PTR) helps you find domain (FQDN) for an IP. As this is reverse to what commonly DNS is used for, this process is often referred as Reverse-DNS lookup  also.

See also  Zimbra Set COS (class of service) All User

Having your FQDN (domain-name) resolve to IP and reverse-lookup for IP back to domain name can improve mail-delivery. This is also called Forward-confirmed reverse DNS.

Check IP address of your server using following command:

host www.habibza.in

You will see lines like below picture.

Checking FQDN, Reverse-DNS PTR, MX record

This below is raw result.

habibza@LNV-MHZ:~$ host www.habibza.in
www.habibza.in is an alias for habibza.in.
habibza.in has address 156.67.212.183
habibza.in has IPv6 address 2a02:4780:3:11:9::11
habibza.in mail is handled by 10 habibza.in.
habibza.in has IPv6 address 2a02:4780:3:11:9::11
habibza.in has address 156.67.212.183

If your server has multiple A records, you will see multiple lines for IP-addresses listed one-per-line. For real example run host google.com.

Please note IP address for now. Check reverse PTR for IP address is correct:

host 156.67.212.183

Outputs:

183.212.67.156.in-addr.arpa domain name pointer srv58.niagahoster.com.

As we can see, reverse DNS lookup for IP shows srv58.niagahoster.com. This is because I am use share hosting. But dont worry, we can add host server in SPF that make our email more eligible in mail deliveribility.

dig command for reverse-DNS/PTR lookup

You can also use dig tool also. Just write IP address in octet-reverse and append in-addr.arpa in the end:

dig +short ptr 183.212.67.156.in-addr.arpa

You will output like:

srv58.niagahoster.com

MX Records

MX record tells Internet which machine will receive mails for a particular domain/subdomain.

Easiest way to check if who is handling mails for your domain is to run again:

host www.habibza.in

You will see lines like below:

host www.habibza.in
www.habibza.in is an alias for habibza.in.
habibza.in has address 156.67.212.183
habibza.in mail is handled by 10 habibza.in.
habibza.in has address 156.67.212.183

As you can see mails for www.habibza.in is handled by habibza.in only (same server).

See also  PFlogsumm - Daily Report Postfix Monitoring on CentOS 6

If you are using Google Apps, you will see outcome like:

rtcamp.com mail is handled by 30 alt2.aspmx.l.google.com.
rtcamp.com mail is handled by 10 aspmx.l.google.com.
rtcamp.com mail is handled by 20 alt1.aspmx.l.google.com.
rtcamp.com mail is handled by 50 aspmx3.googlemail.com.
rtcamp.com mail is handled by 40 aspmx2.googlemail.com.

If you do not see “mail is handled” line, that means your domain do not have a MX record.

That is checking FQDN mx record and PTR. Might be it’s helpful, please feel free to leave a comment if you have any questions and I’ll appreciate it.


Credit original source: rtcamp.com

habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Leave a Reply

Your email address will not be published. Required fields are marked *

Never miss good article from us, get weekly updates in your inbox