Seemed like I had given the wrong information, sorry for the confusion. Just occurred to me that I may have provided the wrong info. Domain1.com is also external1.com (same domain name as our external provider). I think it may have no effect but it may have otherwise.
Lets I’ll step back and start my installation procedure. Most of the steps I made are taken from https://ubuntuforums.org/showthread.php?t=1866784 specially those pre-Zimbra installation – preparation and DNS. I think it is the same guide my predecessor has made to create our present server.
Just to make it clear, I have removed the extenal1.com (it is confusing, I think):
Internal network/domain name: domain.local
Server name: postoffice.domain1.com (192.168.0.1)
Zimbra domain1: domain1.com
Zimbra domain2: domain2.com
External server1: smtp.domain1.com (119.93.x.x)
External server2: smtp.domain2.com (119.93.x.y)
============
/etc/hostname:
postoffice.domain1
============
/etc/network/interfaces
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.5
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.0.1 8.8.8.8
dns-search domain1.com
============
/etc/resolv.conf
nameserver 192.168.0.1
nameserver 8.8.8.8
search domain1.com
============
/etc/bind/named.conf.local
zone "domain1.com" {
type master;
file "/etc/bind/db.domain1.com";
allow-transfer {"none";};
forwarders {8.8.8.8;};
};
zone "domain2.com" {
type master;
file "/etc/bind/db.domain2.com";
allow-transfer {"none";};
forwarders {8.8.8.8;};
};
============
/etc/bind/db.domain1.com
; domain1.com
$TTL 604800
@ IN SOA ns.domain1.com. root.domain1.com. (
20180124 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ); Negative Cache TTL
;
@ IN NS ns
IN MX 10 postoffice
IN MX 10 smtp
IN A 192.168.0.1
ns IN A 192.168.0.1
postoffice IN A 192.168.0.1
smtp IN A 119.93.x.x
www IN A 192.168.0.1
============
/etc/bind/db.domain2.com
; domain2
$TTL 604800
@ IN SOA ns.domain2.com. root.domain2.com. (
20180125 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ); Negative Cache TTL
;
@ IN NS ns
IN MX 10 postoffice
IN MX 10 smtp
IN A 192.168.0.1
ns IN A 192.168.0.1
postoffice IN A 192.168.0.1
smtp IN A 119.93.x.y
www IN A 192.168.0.1
============
admin@postoffice:~$ nslookup domain1.com
Server: 192.168.0.1
Address: 192.168.0.1#53
Name: domain1.com
Address: 192.168.0.1
============
admin@postoffice:~$ nslookup smtp.domain1.com
Server: 192.168.0.1
Address: 192.168.0.1#53
Name: smtp.domain1.com
Address: 119.93.x.x
============
admin@postoffice:~$ nslookup domain2.com
Server: 192.168.0.1
Address: 192.168.0.1#53
Name: domain2.com
Address: 192.168.0.1
============
admin@postoffice:~$ nslookup smtp.domain2.com
Server: 192.168.0.1
Address: 192.168.0.1#53
Name: smtp.domain2.com
Address: 119.93.x.y
============
admin@postoffice:~$ dig domain1.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> domain1.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28427
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;domain1.com. IN A
;; ANSWER SECTION:
domain1.com. 604800 IN A 192.168.0.1
;; AUTHORITY SECTION:
domain1.com. 604800 IN NS ns.domain1.com.
;; ADDITIONAL SECTION:
ns.domain1.com. 604800 IN A 192.168.0.1
;; Query time: 0 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Feb 06 16:42:01 +08 2018
;; MSG SIZE rcvd: 91
============
admin@postoffice:~$ dig domain1.com mx
; <<>> DiG 9.10.3-P4-Ubuntu <<>> domain1.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11646
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 4
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;domain1.com. IN MX
;; ANSWER SECTION:
domain1.com. 604800 IN MX 10 smtp.domain1.com.
domain1.com. 604800 IN MX 10 postoffice.domain1.com.
;; AUTHORITY SECTION:
domain1.com. 604800 IN NS ns.domain1.com.
;; ADDITIONAL SECTION:
smtp.domain1.com. 604800 IN A 119.93.x.x
postoffice.domain1.com. 604800 IN A 192.168.0.1
ns.domain1.com. 604800 IN A 192.168.0.1
;; Query time: 0 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Feb 06 16:42:20 +08 2018
;; MSG SIZE rcvd: 155
============
admin@postoffice:~$ dig domain2.com mx
; <<>> DiG 9.10.3-P4-Ubuntu <<>> domain2.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10800
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 4
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;domain2.com. IN MX
;; ANSWER SECTION:
domain2.com. 604800 IN MX 10 postoffice.domain2.com.
domain2.com. 604800 IN MX 10 smtp.domain2.com.
;; AUTHORITY SECTION:
domain2.com. 604800 IN NS ns.domain2.com.
;; ADDITIONAL SECTION:
smtp.domain2.com. 604800 IN A 119.93.x.y
postoffice.domain2.com. 604800 IN A 192.168.0.1
ns.domain2.com. 604800 IN A 192.168.0.1
;; Query time: 0 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Feb 06 16:42:27 +08 2018
;; MSG SIZE rcvd: 166