I configured a DNS service using bind. It works and I created a domain named test.com . The problem is not in how I configured bind, I already have a positive feedback: I tested it using dig, which returns 192.168.13.3 if I ask the IP address of mail.test.com .
I am now trying to assign an IP address to my postfix server, in a way that I can use telnet passing directly mail.test.com as argument and not localhost, this way:
telnet -b mail.test.com 25
But if I try it, it says:
trying 192.168.13.3...
telnet: connect to address 192.168.13.3: No route to host
trying 2000:0:13::3
telnet: connect to address 2000:0:13::1: Network is unreachable
For how setting the postfix IP address I followed this answer: https://serverfault.com/a/489308/168676
And this is how I've set it in the master.cf file (I am only showing the modified part):
smtp unix - - n - - smtp
-o smtp_bind_address= 192.168.13.3
relay unix - - n - - smtp
-o smtp_bind_address= 192.168.13.3
-o smtp_fallback_relay=
For editing main.cf I followed a guide
And here I'll show the edited parts:
myhostname = mail.test.com
mydomain = test.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks_style = host
Of course before trying to connect via telnet to postfix, I've made it start:
sudo /sbin/service postfix start
If I try it with localhost it works and I am able to send mails. So I guess that the problem is in configuring the IP address.
Additional details
ifconfig output:
[root@localhost postfix]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.13.100 netmask 255.255.255.0 broadcast 192.168.13.255
inet6 fec0::fea9:21c:42ff:fe07:555d prefixlen 64 scopeid 0x40<site>
inet6 fe80::21c:42ff:fe07:555d prefixlen 64 scopeid 0x20<link>
ether 00:1c:42:07:55:5d txqueuelen 1000 (Ethernet)
RX packets 12356 bytes 8090462 (7.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10247 bytes 1423127 (1.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 375 bytes 30453 (29.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 375 bytes 30453 (29.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
PS: the DNS is reachable at 192.168.13.100, I've manually set it this way:
sudo ifconfig eth0 192.168.13.100 netmask 255.255.255.0 broadcast 192.168.13.255
Feel free to ask more info.