How to resolve local hostnames

Hello,

I have a few computers on my network that are getting their IPs via VyOS’s DHCP server. But I would like that also their hostnames would be resolved via VyOS.

How am I supposed to do that? Via DNS? DNS is only forwarding now to googles’ public DNS servers, so should I somehow add my entries there?

I have no idea how to achieve that, so please help me.

Thanks and best regatds,
iks

What settings do you have for your DHCP server? Normally, you would assign your subnet router IP as the name server e.g., for 192.168.1.0/24 you would use 192.168.1.1, that way you have local queries. I believe that if you are using windows machines, you should be able to resolve names just fine.

Hi mirias,

Thank you for promt response. My DHCP is like this:

dhcp-server {
	disabled false
	shared-network-name ETH1_LAN_POOL {
		authoritative enable
		subnet 10.1.0.0/16 {
			default-router 10.1.250.250
			dns-server 10.1.250.250
			lease 86400
			start 10.1.4.100 {
				stop 10.1.4.255
			}
			static-mapping somemachine {
				ip-address 10.1.7.40
				mac-address aa:bb:cc:dd:ee:ff
			}
			...
		}
	}
}

And well yeah Windows machines are resolving their and other samba machine’s hostnames just fine…
Some UX/Linux machines are not seeing each other via hostname as someone needs to resolve that for them.
What I would like to see is something like “nslookup hostname” to resolve that…
I believe I need to make some entries to VyOS’es DNS since all queries like that go trough it…

Currenty I am only forwarding that to Googles DNSs:

dns {
	forwarding {
		cache-size 2000
		listen-on eth1
		name-server 8.8.8.8
		name-server 8.8.4.4
	}
}

but since there is “forwarding” I believe there must be some other option aswell… For kind of custom entries?

Thanks and BR,
iks

I believe dnsmasq is used on the back end, so you should be able to consult the documentation for that.

There is a guide I found for adding a full dns service, http://luisrato.azurewebsites.net/2014/06/17/how-to-install-vyos-routerappliance-as-dns-server/, but some of it might be outdated. You could give it a try in a test lab environment and see if you can get it working.

Hi microlinux and mirias,

Yeah VyOS is betting on dnsmasq to do the job, so I should be able to get it working the way I want there, or I could go with adding full DNS service to my VyOS machine…
But I am kind of hoping, that I can do that in VyOS’es config file, since all the altering done on the OS level behind are gone when VyOS is updated. I like the idea of keeping all the settings in one config file… And I really don’t want to be doing all the OS changes every single time I update it. OK I could go with some scripts, but still - I’d like to avoid that if possible.
But you gave me an idea - if nothing else works, I’ll set up another dedicated VM for DNS. Already found some pretty usable containers with HubDNS, or I can set up my own bind9 or something…

Lets see about it… :slight_smile:

Thanks and best regards,
iks

Hey,

Found a perfect solution by llgomezg here:
http://forum.vyos.net/showthread.php?tid=6857&pid=11241#pid11241

Regards,
iks