Results 1 to 6 of 6

Thread: Postfix name service error

  1. #1
    Join Date
    May 2005
    Beans
    46

    Postfix name service error

    Just recently rebooted my server for the first time in a couple weeks, and now I'm getting this error:

    Code:
    Mar 27 07:18:51 server postfix/smtp[6742]: 77A0F19602F8: to=<xxxx@gmail.com>, relay=none, delay=29794, delays=29794/0.09/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=smtp.gmail.com type=AAAA: Host not found, try again)
    had made some changes to /etc/hosts so thought that could be it, but I changed it back and rebooted.. no luck:

    Code:
    127.0.0.1	localhost
    127.0.1.1	server
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    Anyone have any suggestions?

    Not seeing my logcheck emails anymore, I miss em!
    Last edited by mtweldon; March 28th, 2014 at 05:02 PM.

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Postfix name service error

    Name service error for name=smtp.gmail.com type=AAAA
    Type "AAAA" DNS records apply to IPv6 addresses. Are you or your name service resolver using IPv6?

    Nevertheless, smtp.gmail.com has an IPv6 address as well:
    Code:
    [Seiji@GhostWorld]$ host -t aaaa smtp.gmail.com
    smtp.gmail.com is an alias for gmail-smtp-msa.l.google.com.
    gmail-smtp-msa.l.google.com has IPv6 address 2607:f8b0:400d:c04::6d
    
    [Seiji@GhostWorld]$ host -t a smtp.gmail.com
    smtp.gmail.com is an alias for gmail-smtp-msa.l.google.com.
    gmail-smtp-msa.l.google.com has address 74.125.29.109
    gmail-smtp-msa.l.google.com has address 74.125.29.108
    Note that smtp.gmail.com is an alias ("CNAME") for the same hostname regardless of the request. When I specifically ask for a type "AAAA" address I get the IPv6 representation.

    So I'm guessing you have a name service problem of some kind. Let's try a simple test.
    On the Postfix machine, use the command
    Code:
    host smtp.gmail.com 8.8.8.8
    to make the same DNS query using Google's DNS server at 8.8.8.8. Does that return the same results I get?
    Last edited by SeijiSensei; March 27th, 2014 at 06:20 PM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    May 2005
    Beans
    46

    Re: Postfix name service error

    Seems to look fine

    Code:
    $ host smtp.gmail.com 8.8.8.8
    Using domain server:
    Name: 8.8.8.8
    Address: 8.8.8.8#53
    Aliases: 
    
    smtp.gmail.com is an alias for gmail-smtp-msa.l.google.com.
    gmail-smtp-msa.l.google.com has address 74.125.196.108
    gmail-smtp-msa.l.google.com has address 74.125.196.109
    gmail-smtp-msa.l.google.com has IPv6 address 2607:f8b0:4002:c07::6d
    I can even do this and it works fine..:

    Code:
     $ host -t aaaa smtp.gmail.com
    smtp.gmail.com is an alias for gmail-smtp-msa.l.google.com.
    gmail-smtp-msa.l.google.com has IPv6 address 2607:f8b0:4002:c07::6c
    
    
    $ host -t a smtp.gmail.com
    smtp.gmail.com is an alias for gmail-smtp-msa.l.google.com.
    gmail-smtp-msa.l.google.com has address 74.125.196.109
    gmail-smtp-msa.l.google.com has address 74.125.196.108
    did a little more investigating.

    Is this my problem? If so, how do I fix that?

    Code:
    $ sudo postfix check
    postfix/postfix-script: warning: /var/spool/postfix/etc/ssl/certs/ca-certificates.crt and /etc/ssl/certs/ca-certificates.crt differ
    postfix/postfix-script: warning: /var/spool/postfix/etc/resolv.conf and /etc/resolv.conf differ
    $ cat /etc/resolv.conf 
    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    nameserver 127.0.1.1
    $  cat /var/spool/postfix/etc/resolv.conf 
    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    Last edited by mtweldon; March 27th, 2014 at 07:50 PM.

  4. #4
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Postfix name service error

    I don't know why Postfix would have its own resolv.conf, but perhaps you can fix the problem with a couple of symbolic links.

    Link /var/spool/postfix/etc/resolv.conf to /etc/resolv.conf and similarly for the certs.

    You aren't running Postfix in a chrooted environment are you? One with /var/spool/postfix as the chroot? If so, then you'll need to copy the actual files to the corresponding locations in /var/spool/postfix along with any other files the program needs like libraries, etc. I'm guessing all that is set up correctly, but the resolv.conf and certificates may not have been.
    Last edited by SeijiSensei; March 28th, 2014 at 01:59 PM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    May 2005
    Beans
    46

    Re: Postfix name service error

    Decided to try and uninstall and reinstall and used the tutorial here: https://rtcamp.com/tutorials/linux/u...ix-gmail-smtp/

    seems to work fine now, no idea why it stopped working after a reboot, but good to go now.

    Thank you for attempting to help me out!

  6. #6
    Join Date
    Aug 2014
    Beans
    1

    Re: Postfix name service error

    i have the same problem on ubuntu 14.04lts. when postfix is installed it copies /etc/resolv.conf to /var/spool/postfix/etc/resolve.conf. but for some reason after a reboot/restart the file is not copied and you get the blank file with only the header. after hours of searching the net the only thing i could find is to open a terminal and enter this command:

    sudo cp /etc/resolv.conf /var/spool/postfix/etc/resolv.conf

    it works till next reboot.

    if anybody has a permanent fix please post it. thank you.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •