DNS not listing all entries


(a a) #1

I’m currently doing some testing to see if Nethserver fits my needs and so far it seems to be doing the job pretty well.

I’m currently trying to get DNS up and running and noticed that the table in the DNS-Hosts page doesn’t show all entries from the hosts file, it might be a feature but in my opinion it’s a bug.

My hosts file contains the following sections, created by Nethserver:

  • 10localhost (localhost record)
  • 20hostname (Nethserver host record)
  • 30hosts_remote (manual table records via webgui)
  • 40hosts_local (automatic records via DHCP IP reservations)

The Hosts table on the webgui only shows the 30hosts_remote section, giving no indication that the host computer already has a record in the DNS system and the automatic records are also not showing, giving no indication that a DNS record is created automatically when making a DHCP IP reservation.


(Markus Neuberger) #2

Hello @MewBie,

You may use the “Servername” function in menu for hostname
https://YOURNETHSERVER:980/en-US/FQDN
and the “Network” function for the IP
https://YOURNETHSERVER:980/en-US/NetworkAdapter

“DHCP” in the menu has the entries:
https://YOURNETHSERVER:980/en-US/Dhcp

It’s not on one page, but it’s in the GUI, so you can lookup if an address is in use.
You are right, actually one may set a DNS entry even if a DHCP entry exists for the same device.


(a a) #3

I know the info can be found there, but that does not automatically mean that there is a DNS record in the hosts file that combines the 2.
The hostname for example can only exist in /etc/hostname and the IP address can only exist in the network configuration.

Pretty much the same, the DHCP information is not stored in the hosts file. So just because there is a DHCP lease on an IP address does not automatically mean there is a DNS record.

The only way to confirm if you have all the DNS records you need is to manually check the hosts file instead of just being able to have a look at the table in the webgui.


(Markus Neuberger) #4

No, it’s working, even if only DHCP reservations are stored in the hosts file. Try to ping or nslookup an offline DHCP device, the name will be resolved.
See how it works: https://wiki.debian.org/HowTo/dnsmasq

The DHCP server integrates with the DNS server and allows machines with DHCP-allocated addresses to appear in the DNS with names configured either in each host or in a central configuration file. Dnsmasq supports static and dynamic DHCP leases and BOOTP/TFTP for network booting of diskless machines

You don’t have to set a DNS entry for a DHCP device, it’s done automatically by dnsmasq…
The DNS page just shows the static ip entries(servers etc.), and the DHCP page shows dynamical entries(clients) and reservations. All entries are provided in name resolution.


(a a) #5

This is not about whether it works or not, because it works, but about user-friendliness. To not have to look in 3 different locations to see if all the data is correct when all the data can be read from 1 file and displayed in a table that already gets data from that file but only displays part of the available data.

If I’m looking at a DNS hosts table I want to see all of the hosts that have a record in the DNS system, not just the ones that I put in manually.


(Markus Neuberger) #6

OK, you are absolutely right, that’s not possible in UI but you may use CLI:

grep -Eh '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' /etc/hosts /var/lib/dnsmasq/dnsmasq.leases

EDIT:

Nethserver really does the job, you may install shellinabox, login, put the code line in a script called ./dnslist in this case to see your DNS list in web UI:

Finally I hope that your Nethserver test will be successful. Please report your test results…


(Davide Principi) #7

Could be a nice enhancement! It resembles the “trusted networks” pattern…

List /etc/hosts record under DNS > Hosts page

Added a card here

https://github.com/orgs/NethServer/projects/1#card-4599351


(Markus Neuberger) #8

Hi @davidep,

Don’t forget the leases in /var/lib/dnsmasq/dnsmasq.leases…as they’re not in /etc/hosts

The link is not working…


(Davide Principi) #9

Do you have a GitHub account? Perhaps only members of NethServer organization can see it… I can add you: what’s your user name?


(Markus Neuberger) #10

mrmarkuz

Thanks in advance!


(Markus Neuberger) #11

This was the problem, thanks again!