Name resolution with unqualified names

Xen list at xenhideout.nl
Sat Nov 25 10:30:47 UTC 2017


Kevin O'Gorman schreef op 25-11-2017 5:10:

1. I'm not aware of having installed a DNS server.  Camelot is running 
Xubuntu, one other machine is running Ubuntu, two are running a server 
version of Ubuntu.  Perhaps some or all have a DNS server, but it's not 
because of anything I planned, so I don't know much about it.

2. The means to do the configuration you mention was exactly my 
question.  I used to edit /etc/resolv.conf, but it is no longer a file.

   If you can help me with item #2, I'll be very grateful.


If one server is always running you can install dnsmasq on it, switch 
off DHCP on the router, create a minimal dnsmasq configuration that I 
can tell you,

Tell dnsmasq to either use the router or some global thing for DNS.

But at that point you:

- are dependent on that server for your entire network
- may not have an easy interface to see DHCP leases, until you point a 
webserver to its leases file.

So it would be easy enough to configure e.g. lighttpd on port 81 to 
point directly to /var/lib/dnsmasq/lease/dnsmasq.lease

At this point your server does both DNS and DHCP.

Because it does DHCP, it gives itself as the DNS server for your 
network.

If all your computers have hostnames configured, they will send this 
hostname over DHCP to the dnsmasq server, which will add it to the list 
of hosts it has.

This list is then used for DNS.

The only issue is the .local issue mentioned, but this only happens when 
you use .local explicitly.

As long as you don't use .local explicitly, your ordinary unqualified 
names will still resolve to .local, but the mdns_minimal plugin will not 
stop it.

This is the minimal dnsmasq.conf setup as mentioned:


no-resolv
expand-hosts
domain-needed
bogus-priv

server=8.8.8.8        <-- upstream dns server, can be your router
local=/local/         <-- domain you use for automatic resolving
auth-zone=local       <-- only adds a SOA record

domain=local,192.168.0.0/24    <- attaches the subnet to the domain
dhcp-option=option:router,192.168.0.1    <-- configures the gateway

dhcp-range=192.168.0.100,192.168.0.199,12h    <-- configures the dhcp 
range

dhcp-host=hostname,192.168.0.50   <-- configures a static DHCP IP for a 
given hostname

dhcp-host=00:1f:c6:25:10:e8,192.168.0.6,40000s   <-- does the same based 
on MAC address

and adds a timeout.

dhcp-option=option:classless-static-route,10.8.0.0/24,<serverip>    <-- 
if you have additional static routes such as VPN

                                                                         
that you want all clients to have.

mx-host=server.local,server.local             <-- if you want anything 
to be a mailserver

You can set up an internal mailserver in this way.

You can have emails like kevin at local

Or kevin at camelot.local

Or kevin at camelot

You can add mx records to each individual host so that each individual 
host can now receive emails from other hosts.

"self-mx"

and so on and so on.

But this is all you need with a bit more.




More information about the ubuntu-users mailing list