Can sendmail be used without DNS?
Environment
- Red Hat Enterprise Linux
- sendmail
Issue
- How to use sendmail without DNS?
- Can I setup sendmail to forward outgoing mails to a different system (smarthost), without having DNS available?
Resolution
There are a number of steps required to successfully use sendmail when there is limited or no DNS.
-
Setting a
SMARTHOST-
Ensure the required host is resolvable, either by
/etc/hostsor DNS, or alternatively specify an IP address. -
Use line in
/etc/mail/sendmail.mcthat resemblesdefine(`SMART_HOST',`name.of.smart.host')dnl -
For more information, please see: How to configure a Sendmail Smart Host
-
-
Since the system implicitly have limited resolving capabilities, accept email for unknown domains
- Use line in
/etc/mail/sendmail.mcof the formFEATURE(accept_unresolvable_domains)dnl
- Use line in
-
Ensure that the
ServiceSwitchFile(by default at/etc/mail/service.switch) has content similar to:aliases files hosts files -
Setting the submission agent to ignore DNS
-
Use line in
/etc/mail/submit.mcof the formdefine(`confDIRECT_SUBMISSION_MODIFIERS',`C') -
Use line in
/etc/mail/submit.mcof the formFEATURE(accept_unresolvable_domains)dnl
-
Having completed the above changes remake the submit.cf & sendmail.cf by typing make in /etc/mail
The daemon may also need to be restarted with the command:
# service sendmail restart
Diagnostic Steps
- Various logfiles in directory /var/log can help debugging mail issues.
- To send testmails commands like the following can be used:
# echo "content" | mailx -s "subject" recipient@receiverdomain.example.org
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.