It doesn't work.

mail.example.com record doesn't exist to start with.

Even if I add:

1.2.3.4 example.com
5.6.7.8 mail.example.com

to /etc/hosts

I get:

0A032940922     657 Mon Jul 15 14:40:01  user1@mymachine
(Host or domain name not found. Name service error for name=example.com type=MX: Host not found, try again)
                                         us...@example.com


On 15/07/2024 14:17, Jeff Pang wrote:

Given you want to send mail to foo.com whose mx record is mail.foo.com whose IP is 1.2.3.4

Then write this entry in hosts file:
1.2.3.4  foo.com

Which should work for sending mail.

Regards

On 2024-07-15 21:00, Adam Weremczuk wrote:
What I need to configure for my Debian 12 VM:
- no public or LAN DNS whatsoever
- ability to fetch a single MX record for a single domain

I don't think I can add MX to /etc/hosts which only works for A records.

I'm after a similarly simple, "one liner" solution.

---
Adam


Reply via email to