3 ms·
While I have no need to lookup an address in local computer A's HOSTS file from local computer B as this is not how I use the HOSTS file, in the event that I di
by 1vuio0pswjnm7 3y ago
While I have no need to lookup an address in local computer A's HOSTS file from local computer B as this is not how I use the HOSTS file, in the event that I did want computer B to look up addresses in computer A's HOSTS file, it seems there are many possible options. I could not even come close to listing all of them. (The discussion here is computers on a local network. Is there a need for a "distributed hierarchical system".)
pdns_recursor can serve /etc/hosts
https://docs.powerdns.com/recursor/settings.html https://docs.powerdns.com/recursor/settings.html
unbound can serve "local data"
https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound...
dnsd from busybox can serve a HOSTS file
(exec 2>/dev/null;while read a b c ;do echo "$b $a";done < /etc/hosts|busybox dnsd -c /dev/stdin -p1153 -i 10.21.66.4)
tinydns would work too
echo . > data
while read a b c;do echo =$b:$a:1;done < /etc/hosts >> data
tinydns-data
ROOT=. IP=10.21.66.4 GID=0 UID=0 tinydns
Or just transfer the file instead;
rsync/mrsync could be used to keep computer A and computer B's HOSTS files the same
Or ssh to transfer the HOSTS file from A to B.
echo cat /etc/hosts |ssh -T computerB "cat > /etc/hosts"
Or use ssh to query computer A's HOSTS file from computer B
echo getent hosts name|ssh -T computerB
Or some small httpd, e.g., darkhttpd
httpd /etc --port 1153 --addr 10.21.66.4
tnftp -4o'|grep name' http://10.21.66.4:1153/hosts
It goes on and on.
But I'm not interested in using the HOSTS file in this way on the local network. I'm more interested in IP addresses than "domain names". I am not a fan of web browsers; I make HTTP requests from the shell command prompt and from shell scripts. For example, I like to create shortcuts for certain IP addresses so I do not have to type them, e.g., when using netcat. For me, the HOSTS file works perfectly for that purpose. I use this functionality every day.
Not every computer on my local network has the same ability to lookup names and IP addresses. Most have zero access to DNS data. No lookups. Some may only be able to lookup a few remote addresses. I might put those in the computer's HOSTS file.
- 1vuio0pswjnm7 3y agoThere is a fear or hatred of /etc/hosts amongst web developers. A regurgitated origin story about DNS and a perpetuated myth about the HOSTS file, having to do with constantly dynamic IP addresses. But the truth is that the conditions of the internet have changed. As someone who uses static, stored DNS data, and as such possesses a large chunk of historical DNS data, I have proof that, for the websites I may visit, most IP addresses do not change frequently. Domain names are overrated. Web marketing hype. For example, no one uses a domain name to log into their router. But no one at home is getting internet access without typing an IP address at least once to set up a router. If I want to type a short, memorable name instead of an IP number to reach a computer on the local network I can make an entry in /etc/hosts. Using computers that have no /etc/hosts and no control over DNS sucks. Let web developers use those computers. How many times have I seen developers copy entire portions of RFC 1035 into their code as a "comment". Too many to count. They will always struggle to understand it.
- lolc 3y agoFunny I do use a name to log into my router at home. That worked right away and the name is printed in large friendly letters on the router.
- 1vuio0pswjnm7 3y agoWhy not tell us the name of the router so we can learn about something different. Would be interesting to see a router with a built-in DNS server. Most home routers I have seen require people to type 192.168.0.1, 10.0.0.1 or whatever to set it up or to change settings. If anyone wants to try to argue otherwise, I could provide links to countless PDFs of manuals online showing this step in the set up instructions.
- lolc 3y agoThe router I'm referring to is specific to a provider. Wouldn't be very useful. I've also observed Fritzbox routers using the fritz.box domain for internal networking out of the box.
- 1vuio0pswjnm7 3y agoFor example, https://assets.avm.de/files/docs/fritzbox/fritzbox-7590-ax-v2/fritzbox-7590-ax-v2_man_en_GB.pdf https://assets.avm.de/files/docs/fritzbox/fritzbox-7590-ax-v... "You can also enter the IP address of the FRITZ!Box or the emergency IP. The preset IP address is: http://192.168.178.1 http://192.168.178.1 The emergency IP address is: http://169.254.1.1 http://169.254.1.1" Typing "fritz.box" into a browser is useless unless one already has an internet connection. If it's a remote DNS query then is that really "internal networking". Looks like there's an ad for NFTs at fritz.box along with some links to Javascript files and nothing else. No content. I think I'd rather just use a local address.
- lolc 3y agoSomehow you skipped step 2 that says: "Enter the address http://fritz.box http://fritz.box" which is the expected way to connect to the device and that worked for me even before Internet is set up. What you quote is the alternative method. It does look like the domain fritz.box is not owned by AVM, the manufacturer of the device. Apparently they didn't manage to register this domain once .box became available. So in the future they might want to use fritzbox.internal, if this proposal gets approved.