Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


email and dns

Posted on 2001-07-11
Medium Priority
Last Modified: 2013-12-15
I am back again trying to solve an email/dns problem.  I run a mail server on my small lan ,and have a quasi-permanent connection to the internet.  This means that although my isp is supposed to be providing 24/7 uptime, their service has these strange 60-90 second blackouts every 15-20 minutes they cannot solve.

This affects me because when someone tries to check their email at the same time one of the blackouts are occuring, it causes the response to be really slow.  jlevie pointed out a way to cure the other problem I was having by suggesting I correctly maintain an /etc/hosts file.  But with the blackouts, my pop server has a delay because I think that it is trying to do a reverse lookup of itself.  Here is a sample tcpdump output. is the machine running qmail. is my machine checking for email. is my isp's dns server.

20:14:41.731133 eth0 < > . 1:1(0) ack 1 win 17520 (DF)
20:14:41.732146 eth0 > > 61116+ PTR? (42)
20:14:41.748817 eth0 < > 61116 NXDomain 0/1/0 (104)

So my basic question is what entry, if any, can I place in my /etc/hosts file that will prevent the reverse lookup? (or give the correct response?) I have tried various combinations to little avail.  I would rather not set up a dns server on my lan.  I have only 12 nodes and the changes here are very infrequent at best.

Question by:mattbrice
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 40

Expert Comment

ID: 6279221
Check /etc/nsswitch.conf and make sure that files occurs before dns. It should look like:

hosts:      files nisplus nis dns

The important bits are that files is listed before dns. It doesn't matter about nisplus or nis in this case.

Have you considered that the "blackouts" might be a local problem rather than at your ISP? Is the Linux box the Internet gateway or does something else do that (if so what?)? If it is the gateway what version of Linux is it running and what kind of Internet link do you have (cable modem, SDSL, dialup, T1, etc)?

Author Comment

ID: 6281371
The file /etc/nsswitch already has files ahead of dns.  Any other ideas with respect to /etc/hosts or other files?  What should  my hosts file look like given the information in my original comment?

As far as the blackouts are concerned, they are caused by my isp's system.  I don't use dsl, cable, or dial-up. Because of my location, the only service that I could get (other than a basic dial-up account) was their microwave wireless system. (Which is also very inexpensive) When it works, it is very quick. They have a lot of their wireless customers complaining about the same thing and are aware of the problem.  They just don't know of a solution.

Thanks for the help,

LVL 40

Accepted Solution

jlevie earned 300 total points
ID: 6282051
Okay, so the hostname search order is correct. So either something isn't quite right with the hosts file or there's something in the POP daemon that insists on using DNS. Your hosts file should look like:     localhost.localdomain localhost     host1.domain.tld host1     host2.domain.tld host2

replacing "domain.tld" with your domain name. The hostname that the email server is set to needs to point to one of those entries in the hosts file.

If you still have problems during the outages with the hosts file set up correctly, then the only recourse that I know of will be to set up a local DNS. That's not at all difficult for a small LAN and you would gain a small reduction in link traffic since the local DNS will cache answers. If you don't know how to set up a local DNS I'd be willing to build the configuration for you.
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  


Expert Comment

ID: 6283671
 If you not be sure about the name resolves, do like:

1, run "linuxconf" by root, and find out the domain name server config, and make a right turn between the hosts and systemdns.

2, edit your /etc/hosts file, add a line like: emailerver.yourdomain.com
    ~~~~~~~~~~~~~ is Your email server's IP.

3, check whether the system worked well:
   first, "ping" the domain name about your email server, If the IP address been given is correct, it's OK. Second, run "nslookup" and fill your email server's domain name "emailserver.yourdomain.com" after the prompt ">", get the result, if it also worked, That's OK.

Good Luck :)

Author Comment

ID: 6291401
I have tried the adding the ip of the email server, but it does not seem to make a difference.  I am running qmail + vpopmail.  I do not have the time right this moment to install the dns, but I will be thinking about it.  I have read that djbdns is a good choice, and also authored by the same man who wrote qmail.  

I really appreciate the comments so far.


Author Comment

ID: 6303500
Thanks for all the help.  I decided to follow your advise and set up a local DNS server.  It turned out to be a fairly simple task.  I used djbdns and although I don't have a the features working, it has made checking email lightning fast without sacrificing browsing speed.  

LVL 40

Expert Comment

ID: 6303933

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question