Email - Wrong Server (internal mail server)

Bit of a challenge here.
It appears that NodeRed is resolving my server address to the Public IP. However, I am trying to reach the internally hosted mail server. It is on the same network as my node-red. But, for some reason, it keeps trying to reach the public IP (my public MX record) rather then my internal.

Is there a way to tell Nodered to resolve DNS to the local machine rather then having it reach out to the public?

I don’t think Node-RED is doing anything other than using the operating system calls. Maybe try using the ip address ?

Thanks Dceejay. However, I have confirmed it is not.
Node-Red is running on a windows machine. I do a ping to my mail server from cmd/powershell and I get the correct IP.
I have even added a static entry into the local host file. Node just wants to use the public MX record IP.

Any other ideas?

what happens if you try the same ping command using a Node-RED exec node ?

What server name have you used in the email node?

Are you running node-red in a container such as Docker, or using Home Assistant or something similar?

[Edit] Or running in WSL?