1

I would like to add to an existing LAN a small device running OpenWrt, to act as a Local Area Network DNS using dnsmasq.

I have in my LAN some local servers which would be very handy to use if the people connected to the LAN only had to write "printer.lan" or "localapache.mynet" (or even just "printer" or "localapache") in order to connect to local IP addresses.

I know this can be easily achievable if OpenWrt is also responsible for the network DHCP, but this is not feasible, the device should only add the DNS functionality to the network.

I have read many tutorials, but I could not get them working, or they were assuming something (e.g. http://www.foell.org/justin/pimp-your-lan-with-openwrt-and-dnsmasq/ ).

First of all, using the Luci GUI, I have connected the device in static IP mode to the existing network, assigning it to a free IP (192.168.1.2) and setting the network gateway (192.168.1.1).

After that, I have set "Ignore interface" in the DHCP Server tab (Network -> Interfaces -> LAN).

Then I have tried:

1) Adding hostnames in Network -> Hostnames

2) Adding the domains in Network -> DHCP and DNS -> DNS forwardings

3) Adding the domains as static leases

Unfortunately, none of them worked, I cannot reach the hostnames alone, or hostname.lan either. As test, on Windows I am trying a ping command.

I am quite running out of options, so I would like to ask you how would you proceed. Keep in mind that I can also access via SSH, but I would need some more step-by-step instructions in this case.

Thanks in advance.

Nabbolo
  • 11
  • 1
  • 3
  • An additional doubt: how will the clients connecting to the network know that they should first ask to resolve domain names to the OpenWrt device instead of using the public DNS? Usually the DNS server is assigned to clients when they are assigned their IP address by DHCP, but if the OpenWrt will not act as DHCP, how will this work? – Nabbolo Sep 10 '17 at 09:08
  • Obviously, you *have* to set the OpenWRT host's IP address as the address of DNS server to query on your clients. A "DNS Server" option typically will be announced by the DHCP server and honored by the clients, but in most client implementations, it could be overridden by manual configuration. Also, non-trivial DHCP server implementations will allow you to configure the options announced to clients, so you could change the DNS server to be used in the DHCP server scope settings. – the-wabbit Sep 10 '17 at 19:05

0 Answers0