0

I haven't been able to find any definitive solution to this.

I'm combining several of my machines onto a single one, but would like to use aliases for the hostnames, on my local network. The Pi has avahi on it, and dnsmasq, no bind9. I want to avoid subdomains and multiple IP address.

Basically, it should work like this: any request made to the router for server1, server2, server3 - should go to server0. or to IP 192.168.1.100.

Reason: the music server has one local name, the home-assistant server a different name, the file server another one. Some IoT devices have been configured with a hostname instead of an IP.

Not really critical, just something nice to have, but I've spent already some time toying with both bind9 and dnsmasq with no results (the router doesn't recognize the hostnames). From my router I can only assign one hostname per IP (fritzbox).

I would like to keep avahi, if possible, some other services depend on it.

  • For IP you can probably forward to another IP per router functionality. For DNS you can setup static host A records in your DNS if applicable. Otherwise, add these hostnames to IP in the hosts file of the needed clients. If you have many many clients, I assume you have a DNS server you can create A records. Just quick thoughts. – Pimp Juice IT Feb 15 at 3:02
  • 1
    Does this help? serverfault.com/questions/268401/… – Eduardo Trápani Feb 15 at 4:53
  • @EduardoTrápani perfect! I did not expect it to work but somehow the ".local" is not needed when typing an address. This is the answer! – brainwash Feb 15 at 11:28
  • @PimpJuiceIT unfortunately the router is pretty "commercial" and does not expose advanced settings, I can re-compile the firmware, but the open-source branch they have is very far behind the closed one. The 'hosts' approach is not really possible since there are some IoT devices with no real capabilities or systems without root (Android/iOS). By "clients" I just mean my own devices, not actual people. Or perhaps people visiting me that have bookmarks alreadys set. – brainwash Feb 15 at 11:31
  • Sounds like a job for a DNS server and host A records and just allow your DNS server to handle the forwarding and such. I would explore getting DNS setup and running on a machine on this network. If the router has no support for DNS or helpful features, then get a server DNS services up and running to handle with more robust functionality. If you can assign an IP address to any of these devices IoT or not, you can define what primary DNS server IP address each should use.Otherwise allocate those IPs to the one machines per the SF link per Eduardo or use other correlated methods. – Pimp Juice IT Feb 15 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.