I need to change my external access DNS server and keep the default gateway on my internal access I can´t access local devices using hostname but I can using local IP
when ever I use different DNS from the automatically attributed I can´t access devices by their hostnames but I can by their IPs and smb does not work at all
That’s the problem the server was configured with a static IP, but the router provided by the ISP is not reliable so the server uses dhcp as a fallback and frequently
Besides after DNS swapping I can´t use either hostname or IP on smb Thunar simply asks for a login and after that it fails to connect
So, if the static IP is not an option, I can’t see other option other than the one mentioned above.
However, to run the ISC DHCP server with the option mentioned there are a few requirements.
The computer has been provisioned as an AD DC and the samba, smbd and winbindd daemons are running.
Also, if you have multiple VLANs, you would need to set a DHCP relay for each VLAN pointing to the ISC DHCP server.
Edit: dhcp-dyndns.sh is hooked to my DHCP server.
Edit2: You can remove some IPs from the DHCP pool, and set a static IP directly in the NIC of the server…
This would be the easier approach.
This makes sense since you are connecting directly to an external DNS server.
I am not sure why you can’t connect to smb shares by IP. That shouldn’t require DNS. Have you tried connecting via a cli tool so you can get some kind of meaningful error? Alternatively, have you looked at the logs on the server side?
$ sudo smbclient //{server}/{share} -U {user}
Can't load /etc/samba/smb.conf - run testparm to debug it
Password for [WORKGROUP\{user}]:
do_connect: Connection to {server} failed (Error NT_STATUS_NOT_FOUND)
As far as I understand your problem you have two options:
Option 1:
You tell your dhcp server to give always the same ip addresses to your local servers. Most dhcp server have the option to do this by MAC address. With this you can manage to do name resolution with an /etc/hosts file.
This is a dns forwarder which can forward dns requests to external and local dns servers. In my case for example, I use my Fritzbox to resolve local hostnames and the dns servers from my ISP for everything else. The local name resolution is accomplished by these 3 options in /etc/dnsmasq.conf: