[GH-ISSUE #78] postfix could not resolve dns. #34

Closed
opened 2026-02-26 04:33:50 +03:00 by kerem · 5 comments
Owner

Originally created by @johnbritto1 on GitHub (Jul 6, 2018).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/78

On the first deployment, docker assigns a NAT IP, eg: 10.10.10.2 which is appended on /etc/resolv.conf
When we restart the dns-proxy-server, docker somethings assign different NAT IP, eg 10.10.10.3.
Postfix (In host) usually on restart, copy the /etc/resolv.conf to /var/spool/postfix/etc/resolv.conf
the value set in /var/spool/postfix/etc/resolv.conf is IP: 10.10.10.3.

Hence, I have to restart postfix every time when the IP assigned to dns-proxy-server change.
Is there any way to automate this behaviour.

Thanks.

Originally created by @johnbritto1 on GitHub (Jul 6, 2018). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/78 On the first deployment, docker assigns a NAT IP, eg: 10.10.10.2 which is appended on /etc/resolv.conf When we restart the dns-proxy-server, docker somethings assign different NAT IP, eg 10.10.10.3. Postfix (In host) usually on restart, copy the /etc/resolv.conf to /var/spool/postfix/etc/resolv.conf the value set in /var/spool/postfix/etc/resolv.conf is IP: 10.10.10.3. Hence, I have to restart postfix every time when the IP assigned to dns-proxy-server change. Is there any way to automate this behaviour. Thanks.
kerem 2026-02-26 04:33:50 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@mageddo commented on GitHub (Jul 6, 2018):

Actually DPS have MG_RESOLVCONF env where you can set resolv.conf path, but now it supports only one entry, we can change that to support many entries then DPS will modify them, what do you think about that?

Can you confirm if just updating /var/spool/postfix/etc/resolv.conf makes postfix work again?

<!-- gh-comment-id:403033748 --> @mageddo commented on GitHub (Jul 6, 2018): Actually DPS have [`MG_RESOLVCONF`](https://github.com/mageddo/dns-proxy-server/blob/master/conf/conf.go#L46) env where you can set `resolv.conf` path, but now it supports only one entry, we can change that to support many entries then DPS will modify them, what do you think about that? Can you confirm if just updating `/var/spool/postfix/etc/resolv.conf` makes postfix work again?
Author
Owner

@johnbritto1 commented on GitHub (Jul 6, 2018):

For some reason, I could not test by manually modifying the postfix resolve.conf (/var/spool/postfix/etc/resolv.conf). But surely I will test again and report back
But It looks like when postfix restart, it actually does copy the /etc/resolve.conf to /var/spool/postfix/etc/resolv.conf.
In past, I usually restart postfix and that solve the problem.

I think having MG_RESOLVCONF env to support more than one resolv entry would be a solution.

<!-- gh-comment-id:403037561 --> @johnbritto1 commented on GitHub (Jul 6, 2018): For some reason, I could not test by manually modifying the postfix resolve.conf (/var/spool/postfix/etc/resolv.conf). But surely I will test again and report back But It looks like when postfix restart, it actually does copy the /etc/resolve.conf to /var/spool/postfix/etc/resolv.conf. In past, I usually restart postfix and that solve the problem. I think having MG_RESOLVCONF env to support more than one resolv entry would be a solution.
Author
Owner

@mageddo commented on GitHub (Jul 6, 2018):

Okay, so let's wait your feedback then we can work on that

<!-- gh-comment-id:403039902 --> @mageddo commented on GitHub (Jul 6, 2018): Okay, so let's wait your feedback then we can work on that
Author
Owner

@johnbritto1 commented on GitHub (Nov 22, 2018):

Updating the /var/spool/postfix/etc/resolv.conf with the values of /etc/resolv.conf makes the postfix to function properly.

<!-- gh-comment-id:441021406 --> @johnbritto1 commented on GitHub (Nov 22, 2018): Updating the /var/spool/postfix/etc/resolv.conf with the values of /etc/resolv.conf makes the postfix to function properly.
Author
Owner

@mageddo commented on GitHub (Mar 4, 2023):

MG_RESOLVCONF supports multiple conf files since DPS 3.5.0, see the docs . In your case run DPS docker container with static IP is also an option.

Closing the issue as we already have a solution, thanks for your help.

<!-- gh-comment-id:1454792094 --> @mageddo commented on GitHub (Mar 4, 2023): MG_RESOLVCONF supports multiple conf files since DPS 3.5.0, [see the docs][1] . In your case run DPS docker container with static IP is also an option. Closing the issue as we already have a solution, thanks for your help. [1]: http://mageddo.github.io/dns-proxy-server/latest/en/3-configuration/#environment-variable-configuration
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/dns-proxy-server-mageddo#34
No description provided.