I looked into the history of this. We used to have a patch in Debian to use gethostbyname to address this issue. It was dropped because it caused worse problems. Here's the relevant code snippet from the most recent postfix release:
/* * If the local machine name is not in FQDN form, try to append the * contents of $mydomain. Use a default domain as a final workaround. * * DO NOT CALL GETHOSTBYNAME OR GETNAMEINFO HERE - IT MAKES EVERY POSTFIX * PROGRAM HANG WHEN DNS SERVICE IS UNAVAILABLE. IF YOU DON'T LIKE THE * DEFAULT, THEN EDIT MAIN.CF. */ name = get_hostname(); /* DO NOT CALL GETHOSTBYNAME OR GETNAMEINFO HERE - EDIT MAIN.CF */ if ((dot = strchr(name, '.')) == 0) { /* DO NOT CALL GETHOSTBYNAME OR GETNAMEINFO HERE - EDIT MAIN.CF */ if ((domain = mail_conf_lookup_eval(VAR_MYDOMAIN)) == 0) domain = DEF_MYDOMAIN; /* DO NOT CALL GETHOSTBYNAME OR GETNAMEINFO HERE - EDIT MAIN.CF */ name = concatenate(name, ".", domain, (char *) 0); } /* DO NOT CALL GETHOSTBYNAME OR GETNAMEINFO HERE - EDIT MAIN.CF */ return (name); So the way to resolve this issue is to edit main.cf as people have indicated they are doing. "Fixing" this in postfix is not something we should do. ** Changed in: postfix (Ubuntu) Status: Confirmed => Won't Fix -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1657024 Title: mydomain gets set to "localdomain" To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/1657024/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs