Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

what I need is: automatically add mac-addresses to some file and manually add the hostnames assigned to them, and a script will then scan my home LAN for those mac-addresses and populate the /etc/hosts file, updating whatever cache. most importantly I do not want a centralized server that works as DNS server 24/7 and consumes a lot of energy in addition to the energy consumed already by the modem offering its own LAN-dhcp services. i.e. I need a decentralized DNS service. has anyone ever heard of such a script?

what I want, but I guess that's too much to ask, is some way to automatically read the /etc/hostname file of all computers at the moment they enter my LAN and update name-resolution directly without the need for a /etc/hosts file. anyone an idea if that would be possible without altering the dhcp server?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

As you're probably going to use IP the MAC addresses won't help you at all. What you want is mDNS to reslove local host names. In Ubuntu, this is activated automatically. You should be able to resolve other computer's IP addresses using their name plus .local as in:

my-pc.local
share|improve this answer
    
many thanks, I didn't know mDNS existed. as for mac, in case you didn't know, mac can be displayed by arp (after the ip has been used) so one can check if that hostname really is what you expect. good for security to know mac of all your local devices. –  piotr5 Oct 21 '12 at 13:40
    
But you can change or tell interfaces to use other MAC addresses. Given the nature and purpose of MAC addresses (address resolution via ARP), filtering MAC addresses for security reasons is rather controversial, especially in WiFi networks. –  LiveWireBT Oct 21 '12 at 14:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.