1
I frequently have the problem that I am on a local network where DNS is done by routers I have no control over. I often want to send files or data between two of my devices on the same subnet, but they are assigned a random DHCP address on each connection.Hard-coding addresses, or setting preferred DHCP assignments doesn't seem to work, as a random address is assigned by the router anyway
I am looking for some kind of broadcast based DNS override, or synchronisation system. I am variously using Linux Mint 17 or debian testing.
Is there some package that I can install as a DNS "shim", which will allow the two machines to recognise each other and override their local DNS settings automagically? My current solution is to check the IP on each machine and have a script to update all the settings I need to change manually.
The system doesn't need to be secure, as I am using key based logins between the devices, where I have already shared the keys by copying the file via USB. Any attempt to MITM will be detected at the login stage.
Unfortunately my searching has not got the right combo of keywords to find anything relevant.
Thanks!
Thanks - this seems to work locally, I don't have my second device on me right now. nss-mdns seems to be a plugin (libnss-mdns). The avahi documentation isn't great - no examples, or similar that I can find. Manpages are terse at best.
Thanks again for the advice! I'd looked at avahi, but hadn't understood how to use it.
I assume that for mdns to work, I need to enable it in nsswitch.conf on all devices, not just the one I want to be able to resolve from?
lastly, the .local seems to be compulsory. avahi-resolve wont resolve without it, even though its not part of the computer's host name. – user425952 – 2015-03-08T14:39:04.483
Generally, you don’t need to configure anything at all with Avahi. Except when you want to advertise services. About
.local
: It is part of the host name—the fully qualified host name. You need to editnsswitch.conf
only on devices where you want to be able to resolve host names from all programs. – Daniel B – 2015-03-08T16:09:35.687