Settings not saved via web interface

yeah sorry, i was being uber dumb!

After the ifup command, you can check with:

ip addr show

so, i have ran through that mini guide and seem to have a second IP for my pi as seen in ip addr show

and as far as i can make out i have successfully bound lighttpd to the new IP:

pi@raspberrypi:/etc/lighttpd $ sudo netstat -nltup | grep 'Proto\|lighttpd\|dnsmasq\|dhcpcd'
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 192.168.0.32:80         0.0.0.0:*               LISTEN      10944/lighttpd
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      2922/dnsmasq
tcp6       0      0 :::53                   :::*                    LISTEN      2922/dnsmasq
udp        0      0 0.0.0.0:53              0.0.0.0:*                           2922/dnsmasq
udp        0      0 0.0.0.0:68              0.0.0.0:*                           698/dhcpcd
udp6       0      0 :::546                  :::*                                698/dhcpcd
udp6       0      0 :::53                   :::*                                2922/dnsmasq

but

adverts are still showing unless i manually set the DNS?
i also commented out the relevant part of /etc/lighttpd/lighttpd.conf for IPV6
:confused:

EDIT

I actually get adverts even if i manually set the DNS

Your not suppose to bind lighttpd to the new IP address or you break the DNS to port 80 redirecting again.
lighttpd should be running on the physical interface IP address eth0.
And the Hue application should be configured to listen to the alias interface IP address.

Sh*t

i better get undoing then!

i wanted pi-hole on the second IP as its less effort to change (i think)
as i currently have everything running on the physical IP

any idea how id switch home assistant to run on second IP?

I dont have the software so have no clue.
Try see what comes up if you do below:

sudo grep 'host_ip\|listen_port' -R /etc

no problem, ill ask that community

pi@raspberrypi:/home/homeassistant/.homeassistant $ sudo grep 'host_ip\|listen_port' -R /etc
grep: /etc/systemd/system/multi-user.target.wants/regenerate_ssh_host_keys.service: No such file or directory
Binary file /etc/alternatives/js matches
grep: /etc/alternatives/js.1.gz: No such file or directory
Binary file /etc/alternatives/rsh matches
Binary file /etc/alternatives/node matches
Binary file /etc/alternatives/rlogin matches

which honestly means nothing to me¬

sudo grep 'host|port|listen|bind' -R /home/homeassistant/

ok, so again, thanks to all that have helped me...but im still having some problems with pi-hole.
:confused:

thanks to the above help settings are saved ok via the web interface.

however, if i do not set the DNS manually on my devices, i get resolve errors and cannot browse the web.

I also see adverts on android devices, irrespective of whether i set the DNS manually

I have disabled DHCP on my router and enabled in pi-hole.

Pi has been rebooted, as have the client devices.

If on a client, does below link work ?
http://pi.hole/admin/

If not, the clients are not using Pi-Hole to resolve via DNS.
Whats the IP address for Pi-Hole ?

Whats the output for below 2 on a Linux client:

cat /etc/resolv.conf
nslookup pi.hole

Or if on a Windows client:

ipconfig /all
nslookup pi.hole

thanks again
ssh'd into my Pi:


pi@raspberrypi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
nameserver 127.0.0.1
pi@raspberrypi:~ $ nslookup pi.hole
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   pi.hole
Address: 192.168.0.33

in my Win10 laptop:

C:\Users\Richard>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : Rich-Laptop
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : local
   Default Gateway . . . . . . . . . : fe80::9221:6ff:fe7c:5079%7
                                       192.168.0.1
   DHCP Server . . . . . . . . . . . : 192.168.0.32
   DHCPv6 IAID . . . . . . . . . . . : 342397987
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-34-0E-10-B8-88-E3-CC-D9-7C
   DNS Servers . . . . . . . . . . . : 192.168.0.33
   NetBIOS over Tcpip. . . . . . . . : Enabled

ive omitted some data that i think may be sensitive?

on my laptop if i navigate to http://pi.hole/admin/ i see the admin page...but only if i set the DNS manually

On the client it displays two different IP addresses while they should be one and the same (as Pi-Hole provides both DHCP and DNS now):

DHCP Server . . . . . . . . . . . : 192.168.0.32
DNS Servers . . . . . . . . . . . : 192.168.0.33

Try running below one and reconfigure the network settings:

pihole -r

Ps. On the Windows client, you can run below 2 to renew the DHCP lease after you've run above command:
*Might need to run the Windows command line shell as user "Administrator"

ipconfig /release
ipconfig /renew

And check again with:

ipconfig /all

ok i ran pihole -r and set up as 198.168.0.33 for pihole

i then ran the renew and release commands as admin on Win10 laptop, no good. no access to internet with a DNS resolve error...i have to manually set the DNS in adapter settings

output of ipconfig /all is:

   Default Gateway . . . . . . . . . : fe80::9221:6ff:fe7c:5079%7
                                       192.168.0.1
   DHCP Server . . . . . . . . . . . : 192.168.0.32
   DHCPv6 IAID . . . . . . . . . . . : 342397987
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-34-0E-10-B8-88-E3-CC-D9-7C
   DNS Servers . . . . . . . . . . . : 192.168.0.32
   NetBIOS over Tcpip. . . . . . . . : Enabled

why is it taking 192.168.0.32?
i have set a static IP for the laptop in Pi-hole admin?

fyi, when i set a secondary IP for the Pi, i chose 192.168.0.32 as eth0:0
but added the bind rule for 192.168.0.33 into lighttpd.conf

EDIT
the bind is missing due to re-install...i need to re-add again?

On Pi:

ip link show; echo; ip addr show; echo; ip route show

And try rebooting the Windows machine.

pi@raspberrypi:~ $ ip link show; echo; ip addr show; echo; ip route show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether b8:27:eb:a5:5c:dd brd ff:ff:ff:ff:ff:ff

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:a5:5c:dd brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.32/24 brd 192.168.0.255 scope global eth0:0
       valid_lft forever preferred_lft forever
    inet 192.168.0.33/24 brd 192.168.0.255 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 2a02:c7f:9202:fb00:c66f:515d:5db7:d1d0/64 scope global noprefixroute dynamic
       valid_lft 1995sec preferred_lft 1995sec
    inet6 fd0a:3ac9:fd6f:0:867f:ae2b:8393:def4/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fea5:5cdd/64 scope link
       valid_lft forever preferred_lft forever

default via 192.168.0.1 dev eth0  metric 202
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.33  metric 202

pi@raspberrypi:~ $ sudo service lighttpd reload
[FAIL] Reloading web server configuration: lighttpd failed!

Something is wrong as you dont have two network interfaces "eth0" & "eth0:0".
Instead you somehow managed to squeeze two IP addresses on one interface "eth0".

Whats in:

cat /etc/network/interfaces

And whats in:

tail -10 /etc/dhcpcd.conf

pi@raspberrypi:~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
        post-up iw wlan0 set power_save off

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf



auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
    address 192.168.0.32
    netmask 255.255.255.0
pi@raspberrypi:~ $ tail -10 /etc/dhcpcd.conf

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

interface eth0

static ip_address=192.168.0.33/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
pi@raspberrypi:~ $

Sorry, I was mistaken, the "ip addr show" command is displaying the interfaces properly.

Am prepping some changed instructions but in meantime, whats output of below:

sudo netstat -nltup | grep 'Proto\|lighttpd\|nginx\|dnsmasq\|dhcpcd\|pihole-FTL'

please dont apologise!
it should be me apologising!

pi@raspberrypi:~ $ sudo netstat -nltup | grep 'Proto\|lighttpd\|nginx\|dnsmasq\|dhcpcd\|pihole-FTL'
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 192.168.0.33:80         0.0.0.0:*               LISTEN      2644/lighttpd
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      30751/dnsmasq
tcp6       0      0 :::53                   :::*                    LISTEN      30751/dnsmasq
udp        0      0 0.0.0.0:53              0.0.0.0:*                           30751/dnsmasq
udp        0      0 0.0.0.0:67              0.0.0.0:*                           30751/dnsmasq
udp        0      0 0.0.0.0:68              0.0.0.0:*                           660/dhcpcd
udp6       0      0 :::546                  :::*                                660/dhcpcd
udp6       0      0 :::547                  :::*                                30751/dnsmasq
udp6       0      0 :::53                   :::*                                30751/dnsmasq

Helped out via WebEx.
Turned out that the static IP addresses in the "intrerfaces" file are assigned before the ones in the "dhcpcd.conf" file.
Leaving dnsmasq to think the one in the "intrerfaces" file (the alias interface) to be the primary one and the one in the "dhcpcd.conf" file (physical interface) to be the secondary.
Only fix I could think of was move all the static IP address assignments from "dhcpcd.conf" into the "intrerfaces" file.
Tried other way around but no go as dhcpcd5 didnt work on the alias interface.
Stupid dhcpcd5 :wink: