while connect to the vpn i can access the network via the ip address and not the hostname
If I type \\192.168.0.4 (file://192.168.0.4) I get through if I type \\mainsrv (file://mainsrv) I don’t get through
It most probably depends on the DNS. Which DNS server is configured on the client? The client should use a DNS server that can resolve these names.