Name resolution with unqualified names

Gene Heskett gheskett at shentel.net
Sat Nov 25 17:12:29 UTC 2017


On Saturday 25 November 2017 05:30:47 Xen wrote:

> 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.
>
So quit mewling about it and make it a file, put what works for you in 
it, and make it immutable. NM and ALL its ilk are solutions that usually 
don't work in search of a problem that doesn't exist on the typical home 
sized network. Run dd-wrt and dnsmasq on the router. Do NOT bridge the 
wifi to your local lan unless your lappy needs access to the local net. 
That way nobody can drive by, get access to the local net and have fun 
seeing how much damage they can do, because all they can do is steal 
some bandwidth, which you may not know about until you get your net bill 
at the end of the month and an extra 80GB has been used while you were 
snoozing.  Lesson? Turn off the radio unless its in local use.

>
> 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.


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>




More information about the ubuntu-users mailing list