Solaris Troubleshooting DNS : Checking DNS settings to troubleshoot sendmail

In this post we will discuss about the commands to check DNS configuration and functions for sendmail.

Follow these steps to:

  • ensure dns client configuration is in place and enabled;
  • verify mail exchanger lookups are successful (if using DNS for mail exchanger lookups).
  • To resolve error conditions, consult your DNS or Sendmail administrator for proper configuration parameters for your environment.

Is system configured as a DNS client:

Solaris 8, 9 and 10:

/etc/nsswitch.conf  “hosts:” line contains “dns” keyword
/etc/resolv.conf exists with a minimum configuration of at least 2 (3 preferred) nameserver IP addresses

 

To check for a mail exchanger (MX) record for a domain:


using nslookup


# nslookup (type this command and return)
Default Server: nameserver.somedomain.COM
Address: 129.168.1.2
> set (type this command and return)
> yahoo.com (type in the domain in question, results follow)
Server: nameserver.somedomain.COM
Address: 129.168.1.2

Non-authoritative answer: yahoo.com preference = 5, mail exchanger = mx1.yahoo.com
yahoo.com preference = 5, mail exchanger = mx2.yahoo.com
yahoo.com preference = 5, mail exchanger = mx3.yahoo.com
yahoo.com preference = 5, mail exchanger = mx4.yahoo.com

Authoritative answers can be found from:
yahoo.com nameserver = ns1.yh.net
yahoo.com nameserver = ns2.yh.net
yahoo.com nameserver = ns3.yh.net
yahoo.com nameserver = ns4.yh.net
yahoo.com nameserver = ns5.yh.net
mx1.yahoo.com internet address = 65.54.244.8
mx1.yahoo.com internet address = 65.54.245.8
mx1.yahoo.com internet address = 65.54.244.136
mx2.yahoo.com internet address = 65.54.244.168
mx2.yahoo.com internet address = 65.54.244.40
mx2.yahoo.com internet address = 65.54.245.40
mx3.yahoo.com internet address = 65.54.244.200
mx3.yahoo.com internet address = 65.54.244.72
mx3.yahoo.com internet address = 65.54.245.72
mx4.yahoo.com internet address = 65.54.245.104
mx4.yahoo.com internet address = 65.54.244.104
mx4.yahoo.com internet address = 65.54.244.232
ns1.yh.net internet address = 207.68.160.190
ns2.yh.net internet address = 65.54.240.126
ns3.yh.net internet address = 213.199.161.77
ns4.yh.net internet address = 207.46.66.126
ns5.yh.net internet address = 65.55.238.126

 

using dig    (“ANSWER” greater than 0 indicates # of records found)

# dig -t mx yahoo.com

; <<>> DiG 8.3 <<>> -t yahoo.com
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 5, ADDITIONAL: 17
;; QUERY SECTION:

;; yahoo.com, type = MX, class = IN

;; ANSWER SECTION:

yahoo.com. 47m34s IN MX 5 mx2.yahoo.com.
yahoo.com. 47m34s IN MX 5 mx3.yahoo.com.
yahoo.com. 47m34s IN MX 5 mx4.yahoo.com.
yahoo.com. 47m34s IN MX 5 mx1.yahoo.com.

;; AUTHORITY SECTION:

yahoo.com. 6h4m35s IN NS ns1.yh.net.
yahoo.com. 6h4m35s IN NS ns2.yh.net.
yahoo.com. 6h4m35s IN NS ns3.yh.net.
yahoo.com. 6h4m35s IN NS ns4.yh.net.
yahoo.com. 6h4m35s IN NS ns5.yh.net.

;; ADDITIONAL SECTION:

mx2.yahoo.com. 47m34s IN A 65.54.244.168
mx2.yahoo.com. 47m34s IN A 65.54.244.40
mx2.yahoo.com. 47m34s IN A 65.54.245.40
mx3.yahoo.com. 47m34s IN A 65.54.244.200
mx3.yahoo.com. 47m34s IN A 65.54.244.72
mx3.yahoo.com. 47m34s IN A 65.54.245.72
mx4.yahoo.com. 47m34s IN A 65.54.245.104
mx4.yahoo.com. 47m34s IN A 65.54.244.104
mx4.yahoo.com. 47m34s IN A 65.54.244.232
mx1.yahoo.com. 47m34s IN A 65.54.244.8
mx1.yahoo.com. 47m34s IN A 65.54.245.8
mx1.yahoo.com. 47m34s IN A 65.54.244.136
ns1.yh.net. 1d1h41m34s IN A 207.68.160.190
ns2.yh.net. 7m13s IN A 65.54.240.126
ns3.yh.net. 7m13s IN A 213.199.161.77
ns4.yh.net. 7m13s IN A 207.46.66.126
ns5.yh.net. 7m13s IN A 65.55.238.126

;; Total query time: 62 msec

;; FROM: solarishost to SERVER: default — 129.168.1.2
;; WHEN: Thu Apr 3 15:34:41 2008
;; MSG SIZE sent: 29 rcvd: 479<

If an MX record is not found:

Doublecheck with DNS adminstrator if one should exist and if so, query it directly using the hostname and address supplied by your DNS admin and use the command:

  • nslookup <hostname or IP address>
  • dig <hostname or IP address>
  • getent hosts <hostname or IP address>

 

using getent (when using getent, a database must be supplied i.e. hosts for name resolution queries. Since getent does not query the DNS name servers directly, use the argument “mailhost”)

 

root@solarishost# getent hosts mailhost

129.148.9.192 mailhost.foo.com
129.148.13.5 mailhost.foo.com

if getent cannot find a match for mailhost it will return the prompt without output:

root@solarishost# getent hosts mailhost
root@solarishost#

using /usr/lib/sendmail -d

to output sendmail version; compiled with; OS Defines; Kernel symbols; Conf file; Pid File; Canonical name; UUCP nodename; alias names; system identity and total requests in /var/spool/mqueue:

root@solarishost# /usr/lib/sendmail -d0.11 -bp

Version 8.13.8+Sun

Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS NISPLUS PIPELINING SCANF STARTTLS TCPWRAPPERS USERDB USE_LDAP_INIT XDEBUG

OS Defines: HASCLOSEFROM HASFCHOWN HASFCHMOD HASFDWALK HASGETUSERSHELL HASINITGROUPS HASLDAPGETALIASBYNAME HASLSTAT HASNICE HASRANDOM HASRRESVPORT HASSETREGID HASSETREUID HASSETRLIMIT HASSETSID HASSETVBUF HASURANDOMDEV HASSTRERROR HASULIMIT HASUNAME HASUNSETENV HASWAITPID IDENTPROTO IP_SRCROUTE SAFENFSPATHCONF SYS5SETPGRP SYSTEM5 USE_DOUBLE_FORK USE_SA_SIGACTION USE_SIGLONGJMP USESETEUID

Kernel symbols: /dev/ksyms
Conf file: /etc/mail/submit.cf (default for MSP)
Conf file: /etc/mail/sendmail.cf (default for MTA)
Pid file: /var/run/sendmail.pid (default)
Canonical name: solarishost.nisplus.com
UUCP nodename: solarishost
a.k.a.: solarishost.nisplus.com
a.k.a.: [10.10.11.88]
a.k.a.: [127.0.0.1]
a.k.a.: loghost
Conf file: /etc/mail/sendmail.cf (selected)
Pid file: /var/run/sendmail.pid (selected)

============ SYSTEM IDENTITY (after readcf) ============

(short domain name) $w = solarishost
(canonical domain name) $j = solarishost.nisplus.com
(subdomain name) $m = nisplus.com
(node name) $k = solarishost

========================================================

/var/spool/mqueue is empty
Total requests: 0

using /usr/lib/sendmail -bt test mode:

To query a domain for mailserver (MX) records:

root@lab88# /usr/lib/sendmail -bt

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)

Enter <ruleset> <address>

> /mx yahoo.com [type in /mx domain2query.com and return]

getmxrr(yahoo.com) returns 7 value(s):

c.mx.mail.yahoo.com.
f.mx.mail.yahoo.com.
b.mx.mail.yahoo.com.
a.mx.mail.yahoo.com.
e.mx.mail.yahoo.com.
d.mx.mail.yahoo.com.
g.mx.mail.yahoo.com.

(control-D to exit)

Ramdev

Ramdev

I have started unixadminschool.com ( aka gurkulindia.com) in 2009 as my own personal reference blog, and later sometime i have realized that my leanings might be helpful for other unixadmins if I manage my knowledge-base in more user friendly format. And the result is today's' unixadminschool.com. You can connect me at - https://www.linkedin.com/in/unixadminschool/

2 Responses

  1. February 3, 2012

    […] more: Solaris Troubleshooting DNS : Checking DNS … – gurkulindia.com Posted in 10, 4, add, address, and, at, client, Com, Config, configuration, Configure, dns, end, […]

  2. December 11, 2013

    […] Read the original post: Solaris Troubleshooting DNS – unixadminschool.com […]

What is in your mind, about this post ? Leave a Reply

Close
  Our next learning article is ready, subscribe it in your email

What is your Learning Goal for Next Six Months ? Talk to us