Huu Phan | Blog Linux operating system | Linux operating system -Blog Huu Phan | Powered by Blogger.

My blog about Open Source: Zimbra Mail Server,linux,bash script,centos,linux command...

reverse dns lookup script

How to use bash script check check reverse dns lookup. You can check online reverse dns lookup with or , so forth.

Reverse dns lookup full script

    # Author: HuuPV
    # MTA Reverse DNS lookup:
    # For MTA
    # dig +short @
    # dig -x +short @

    rm -f /tmp/reverse_lookup_MTA
    DIG1=$(dig $MTA +short @
    PTR1=$(dig -x $DIG1 +short @ | sed 's/.$//')

    #To check MTA DNS lookup status
    echo "##### MTA Reverse DNS lookup and PTR Query #####" >/tmp/reverse_lookup_MTA
    if [ "$MTA" != "$PTR1" ]; then
        echo "$MTA != $PTR1" >>/tmp/reverse_lookup_MTA
        echo "Reverse lookup Failed!" >>/tmp/reverse_lookup_MTA
    elif [ "$IP1" != "$DIG1" ]; then
        echo "$IP1 != $DIG1" >>/tmp/reverse_lookup_MTA
        echo "Lookup the IP address Failed!" >>/tmp/reverse_lookup_MTA
        echo "$DIG1 = $MTA" >>/tmp/reverse_lookup_MTA
        echo "Sucess!" >>/tmp/reverse_lookup_MTA
    echo ""

I hope will this helpful for you

post new :

Huu Phan | Blog Linux operating system | Huu Phan ~ Zimbra Mail Server,linux,bash script,centos,linux command |

This Blog is protected by