DNS at my office to resolve the FQDN of FreePBX to its LAN address,

Dear, all,
I’m facing a problem registering softphone FreePBX with public IP on the Local network. (when I’m connected to my office Internet. I have deployed FreePBX in my office and using the same internet on FreePBX) and when I disconnect my office internet and turn on my Mobile data softphone registered successfully.
this problem is only when I connected to my office internet.

Please help me How I can set up DNS at my office Mikrotik Router to resolve the FQDN of PBX to its LAN address, while other DNS servers (when at home or on mobile data) resolve to the office public IP


Please help me in this regard.
Thanks
naaaat.PNG

Add a static DNS record on your router pointing to the local IP, should be enough ?

When you connect on the network of that router, it will resolve to the local IP address.
When you are outside that network, it will resolve to the external address.

IP / DNS / static

I have tried adding Static DNS, Please help me If I’m not doing it in the correct way.
172.16.0.69 is LAN IP of FreePBX.
na.PNG

Looks ok to me.

And how are DNS settings in your DHCP config ?
Because if your clients are not passing your router for DNS, then the record will not be used.

It looks like that I think it’s not reading my static DNS entry
dhcc.PNG

DHCP Network, set DNS server to your router.

Still same issue
dhcc.PNG

ONLY router IP.
The other DNS (why 2 times the same ?) will be used by the router.

The client request DNS record from router. When the router does not have it in cache, it will request it from your other DNS.

And make sure to renew lease on client or it will “remember” the old setting.
Cmd: ipconfig /renew

Only router IP in DNS or my IP-PBX IP.
My Router IP is 172.16.0.1/16 and my PBX IP is 172.16.0.69
what I write here?

On your previous screenshot for DHCP network your have THREE DNS entries.
Remove the two for 8.8.8.8 and 8.8.4.4.
ONLY your router IP should be left there. NOT pbx (it doesn’t handle DNS !)

That way your client devices will request DNS from your router and only your router.

Ok I will try

not working

You DID renew the lease ?

From your client:
ipconfig / all

yes I have tried whe I renwe it assigin DNS = 172.16.0.1
but the internet stopped working

What router do you have ?
Can you export config ?
terminal: /export file=anynameyouwish
Move export to computer and review contents, remove serial number and any public WAN IP or passwords.
Then post between [ code ] quotes for easier readability.

I have Mikrotik CCR 2004-16G-2S+ arm64.