Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dnsmasq problem

Featured Replies

I am trying to set up Wifi AP on OrangePi Zero board.

 

Basically, I install and configure hostapd and dnsmasq and create a script, which does the following (it is run as sudo):

 

nmcli radio wifi off
rfkill unblock wlan
ifconfig wlan0 172.16.0.1 netmask 255.255.255.0 broadcast 172.16.1.255
service dnsmasq restart
/usr/sbin/hostapd /etc/hostapd/hostapd.conf

 

This is the /etc/dnsmasq.conf:

 

port=53

domain-needed

bogus-priv

resolv-file=/etc/dnsmasq/resolv.conf

interface=wlan0

listen-address=172.16.0.1

bind-interfaces

addn-hosts=/etc/dnsmasq/hosts.conf

dhcp-range=172.16.0.50,172.16.0.150,12h

dhcp-leasefile=/var/lib/misc/dnsmasq.leases

domain=orangepi.wifi

no-resolve

server 8.8.8.8

server 8.8.4.4

local=/orangepi.wifi/


I also have in /etc/dnsmasq/resolv.conf:

 

nameserver 127.0.0.1


And in /etc/dnsmasq/hosts.conf:

 

172.16.0.1 orangepi.wifi

172.16.0.1 www.orangepi.wifi

So... I run the script, SSID appears, and I can connect to the OrangePi Access Point. I get the IP address (within DHCP range), from OrangePiI can ping the connected device, and from the device I can ping OrangePi (ping 172.16.0.1). From the device I can ping 8.8.8.8, but if I try to ping www.google.com, DNS resolving does not work. (From OrangePi internet is working good).

 

I assumed ther eis some problem with Dnsmasq, so I installed udhcpd instead, but the problem is the same.

 

Any idea?

2 hours ago, Matthai said:

172.16.0.1 netmask 255.255.255.0 broadcast 172.16.1.255

172.16.0.1

172.16.1.255

could it be that one ?

  • Author

Well, yes, that was my mistake, I corrected it, but it is still not working.

 

Anyway, it seems I pasted wrong config here. My /etc/dnsmasq.conf is:

# Configuration file for dnsmasq.
port=53
domain-needed
bogus-priv

resolv-file=/etc/dnsmasq/resolv.conf
no-resolv

server=8.8.8.8
server=8.8.4.4

interface=wlan0
listen-address=172.16.0.1
bind-interfaces

addn-hosts=/etc/dnsmasq/hosts.conf

dhcp-range=172.16.0.50,172.16.0.150,12h

dhcp-leasefile=/var/lib/misc/dnsmasq.leases

domain=orangepi.wifi
local=/orangepi.wifi/

 

  • Author

Of course, I am doing IP forwarding:

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

And this:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

 

Your upstream resolvers should be definef in this file using the standard convention

nameserver x.x.x.x
 

resolv-file=/etc/dnsmasq/resolv.conf
no-resolv




These lines aren't what you're looking for Remove them. They require more parameters and are for a different purpose. The server argument is for directing request for a specific domain to an alternate name server:
 

server=8.8.8.8
server=8.8.4.4



 

  • Author
6 hours ago, lanefu said:

Your upstream resolvers should be definef in this file using the standard convention

nameserver x.x.x.x

 

In this file, you mean in /etc/dnsmasq.conf?

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.