Hello. I have a problem resolving the public ip of my machine since i changed the ip address of mail-in-a- box.
I have installed mail-in-a-box in a virtual machine in a phisical vmware server (It is not installed in a cloud, it is in a machine in my own network).
From outside of the network, i can resolve the name of the server correctly
C:\Users\marcosms>ping correo.tabigal.com
Haciendo ping a correo.tabigal.com [185.179.142.57] con 32 bytes de datos:
Respuesta desde 185.179.142.57: bytes=32 tiempo<1m TTL=64
From a computer in my local network, i have the same (The domain resolves to a public ip).
But if I check in the terminal of the mail-in-a-box installation, I can see this.
root@box:/etc/bind# dig correo.tabigal.com
; <<>> DiG 9.11.3-1ubuntu1.16-Ubuntu <<>> correo.tabigal.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20038
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 8c76bcf1a00b5f08cdebb08261f7f7d3c98f55a4cd8d1db2 (good)
;; QUESTION SECTION:
;correo.tabigal.com. IN A
;; ANSWER SECTION:
correo.tabigal.com. 86400 IN A 192.168.0.23
;; AUTHORITY SECTION:
tabigal.com. 172799 IN NS ns3.dinahosting.com.
tabigal.com. 172799 IN NS ns2.box.correo.tabigal.com.
tabigal.com. 172799 IN NS ns1.box.correo.tabigal.com.
tabigal.com. 172799 IN NS ns4.dinahosting.com.
tabigal.com. 172799 IN NS ns2.dinahosting.com.
tabigal.com. 172799 IN NS ns.dinahosting.com.
;; Query time: 647 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jan 31 15:53:07 CET 2022
;; MSG SIZE rcvd: 214
Note than the “Answer Section” says that the public ip of “correo.tabigal.com” is “192.168.0.23” instead of my public ip address.
But some of the domains that i have installed in this machine brings the right IP adress, like “correo.disacustic.com”. This address resolves to my public ip if I made a “dig” command.
It appears that bind have a problem since i changed the public ip of the machine, but i don’t know how to solve it.
What I say is that everything seems to stay the same. Nothing changed when I execute the “mailinabox” command. I try to execute it one more time, but i made it about 3 or 4 times and nothing changes.
What i see is the following. When the “mailinabox” command finished, i tryed to made a “dig box.correo.tabigal.com” command and I obtained the right ip. So, i Went to the admin page of mail-in-a-box to see if any of the errors disappeared. Then I noticed that i have still errors in the admin panel, so i runed the “dig box.correo.tabigal.com” command and… The wrong ip is again here!!
This is what i can see in terminal.
This is what i can see in terminal.
root@box:/home/marcosms# dig box.correo.tabigal.com
; <<>> DiG 9.11.3-1ubuntu1.16-Ubuntu <<>> box.correo.tabigal.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19871
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 5
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 668079f3d4ca5ed13876da8b61f8018bc3004648f3b623e0 (good)
;; QUESTION SECTION:
;box.correo.tabigal.com. IN A
;; ANSWER SECTION:
box.correo.tabigal.com. 272 IN A 185.179.142.57
;; AUTHORITY SECTION:
tabigal.com. 289 IN NS ns3.dinahosting.com.
tabigal.com. 289 IN NS ns.dinahosting.com.
tabigal.com. 289 IN NS ns2.dinahosting.com.
tabigal.com. 289 IN NS ns4.dinahosting.com.
;; ADDITIONAL SECTION:
ns.dinahosting.com. 289 IN A 185.192.220.10
ns2.dinahosting.com. 289 IN A 185.192.221.10
ns3.dinahosting.com. 289 IN A 185.192.222.10
ns4.dinahosting.com. 289 IN A 185.192.223.10
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jan 31 16:34:35 CET 2022
;; MSG SIZE rcvd: 242
root@box:/home/marcosms# dig box.correo.tabigal.com
; <<>> DiG 9.11.3-1ubuntu1.16-Ubuntu <<>> box.correo.tabigal.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35303
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 5
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: a9275972358e8e7fde2444d361f801c8bb628ac7667df94f (good)
;; QUESTION SECTION:
;box.correo.tabigal.com. IN A
;; ANSWER SECTION:
box.correo.tabigal.com. 86373 IN A 192.168.0.23
;; AUTHORITY SECTION:
tabigal.com. 282 IN NS ns4.dinahosting.com.
tabigal.com. 282 IN NS ns.dinahosting.com.
tabigal.com. 282 IN NS ns2.dinahosting.com.
tabigal.com. 282 IN NS ns3.dinahosting.com.
;; ADDITIONAL SECTION:
ns.dinahosting.com. 282 IN A 185.192.220.10
ns2.dinahosting.com. 282 IN A 185.192.221.10
ns3.dinahosting.com. 282 IN A 185.192.222.10
ns4.dinahosting.com. 282 IN A 185.192.223.10
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jan 31 16:35:36 CET 2022
;; MSG SIZE rcvd: 242
root@box:/home/marcosms#
You can see that I obtained something different at the second try.
And this is what I can see in the admin panel of mail-in-a-box
This domain must resolve to your box's IP address (185.179.142.57) in public DNS but it currently resolves to 192.168.0.23. It may take several hours for public DNS to update after a change. This problem may result from other issues listed above.
That file contains the addresses used by the last “sudo mailinabox”. If your system is somehow picking up the wrong local or external IP address for the setup, you should see it in that file.
You can edit the file and “sudo mailinabox” again, as the contents of mailinabox.conf becomes the new defaults.
For your info, /etc/hosts and your DNS server (nsd) are two separate systems.
Ping asks Linux to to convert name into IP address, then tries to contact it. Linux uses /etc/hosts or (if it can’t find it) your default DNS resolver (probably your provider’s DNS server if you’re hosted, or your router if local). So ping will uses “hosts” or an external server, not necessarily your local name server (nsd).
You can tell dig which name server to ask. Try “dig @185.179.142.57box.correo.tabigal.com” to ask your own name server what the address of your box is. Your “nsd” process (your name server) doesn’t use “hosts” at all.