Omega 2 Pro DNS Servers
Does the Onion OS use hardwired DNS Servers?
I expected my Omega 2 Pro to use the DNS Servers supplied by my DHCP Server but although it appears to resolve hosts on the internet it can't resolve hosts which are set up in my internal DNS Servers.
It seems that Onion OS is using 127.0.0.1 as its DNS Server ... dnsmasq, but what is it using?
How do I force dnsmasq to use the servers provided by DHCP?
I don't want to hardcode DNS servers as I want to be able to deploy to multiple locations and in most cases need to resolve hosts which are only in the DHCP identified servers.
@Alchemist DNSMasq by default uses peer DNS servers which are configured in /etc/config/network or you can use uci show network these peer dns servers are under wan.dns and if you you are using dhcp to set your Omega's ip and DNS then these will be the DNS' provided by your dhcpd. Check you are actually using dhcp using the command
uci show network.wan.proto it should report network.wan.proto='dhcp'
I'm not a big fan of dnsmasq unless you have a specific need to filter etc, it's really a DNS server and in most cases you don't need a DNS server on your Omega device, you can remove it and let your device use your usual network DNS.
@crispyoz Thanks for the advice unfortunately things don't appear to be quite like you suggest.
root@Omega-FCC8:~# uci show network network.loopback=interface network.loopback.ifname='lo' network.loopback.proto='static' network.loopback.ipaddr='127.0.0.1' network.loopback.netmask='255.0.0.0' network.globals=globals network.globals.ula_prefix='fd1d:48c4:7633::/48' network.wlan=interface network.wlan.type='bridge' network.wlan.proto='static' network.wlan.ipaddr='192.168.3.1' network.wlan.netmask='255.255.255.0' network.wlan.ip6assign='60' network.wwan=interface network.wwan.ifname='apcli0' network.wwan.proto='dhcp' network.wwan.hostname='Omega-FCC8' network.wan=interface network.wan.ifname='eth0' network.wan.proto='dhcp' root@Omega-FCC8:~#
Just to be sure that I hadn't broken something I've just done a Factory Reset and gone through the process of adding the device to my LAN again.
Doing an nslookup of an internet host I get ...
root@Omega-FCC8:~# nslookup onion.io Server: 127.0.0.1 Address: 127.0.0.1#53 Name: onion.io Address 1: 18.104.22.168 Address 2: 22.214.171.124 Address 3: 126.96.36.199 Address 4: 188.8.131.52 *** Can't find onion.io: No answer root@Omega-FCC8:~#
Doing an nslookup of a local host in my DNS ...
root@Omega-FCC8:~# nslookup omega.ialchemy.com.au Server: 127.0.0.1 Address: 127.0.0.1#53 *** Can't find omega.ialchemy.com.au: No answer *** Can't find omega.ialchemy.com.au: No answer root@Omega-FCC8:~#
Before doing the reset I was able to access Node-RED on the device via that FQDN so my local DNS works for my local workstations but although the device is getting its address via DHCP its not using the supplied DNS servers.
It is clearly using something as it can resolve external names.
I don't need to be running a DNS server on the device so if dnsmasq is a problem what's the best way to disable/remove it?
@Alchemist opkg remove dnsmasq will remove dnsmasq, I would then reboot the device and if you check in /etc/resolv.conf you will notice the dns provided by your network dhcpd
@crispyoz Thanks for that ... the device can now resolve local names.
root@Omega:~# nslookup omega.ialchemy.com.au Server: 10.0.1.2 Address: 10.0.1.2#53 Name: omega.ialchemy.com.au Address 1: 10.0.1.161 *** Can't find omega.ialchemy.com.au: No answer root@Omega:~#
and it seems to picking up my primary and the two secondaries.
root@Omega:~# cat /etc/resolv.conf # Interface wwan nameserver 10.0.1.2 nameserver 10.0.1.3 nameserver 10.0.1.6 search ialchemy.com.au root@Omega:~#
Taking out dnsmasq has also taken out the DHCP service on the wlan interface. Its nice to be able to connect to wlan without having to set a static address in the range but I'd really like wlan to ONLY be enabled if wwan is unable to connect to the network so I guess its not a big deal as I don't intend to use the device in AP mode.
@Alchemist you can use odhcpd instead of dnsmasq as your dhcpd if you need one. Docs are here: