Forever free pihole blocking on google cloud compute

Hafi

Arch-Supremacy Member
Joined
Mar 30, 2003
Messages
15,340
Reaction score
5,351
I see.

I have just set up one instance of Adguard Home on the Google Cloud free tier virtual micro server.

I have yet to set up the DNS over TLS/HTTPS function with adguard home yet. But it is possible.

Ref: a bit outdated guide

https://frankindev.com/2019/11/26/do...n-adguardhome/

Another guide in Traditional Chinese

https://www.jkg.tw/p2660/

Screenshot from Adguard Home web interface
5mRXPW6.jpg

nice... setting it up on Windows is also easy and works right out of the box. The hard part is probably to remember open up port 80, 53 and 443 in Windows firewall. =:p

1) since the DNS is hosted on a server in a DC, is there any way/workaround to make AdGuard identify the individual clients connecting to it since DHCP is not available on AdGuard itself?

2) Access control list only accepts CIDR or IP addresses, is there any way to make DDNS work since most of us have dynamic IP address? If not then maybe some guru know his way around the API with DNS-O-Matic. https://dnsomatic.com/docs/api
 

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
In advance dns setting, should we check this box " use DNSSEC"?

What are the pros & cons when using this setting?

https://docs.pi-hole.net/guides/tor/dnssec/

As per Pi-hole documentation it is not officially supported.

On the other hand, even without ticking the option, I can pass the tests mentioned in the link from the above site.

DNSSEC test site
https://dnssec.vs.uni-due.de

From Pi-Hole settings page:
Validate DNS replies and cache DNSSEC data. When forwarding DNS queries, Pi-hole requests the DNSSEC records needed to validate the replies. If a domain fails validation or the upstream does not support DNSSEC, this setting can cause issues resolving domains. Use Google, Cloudflare, DNS.WATCH, Quad9, or another DNS server which supports DNSSEC when activating DNSSEC. Note that the size of your log might increase significantly when enabling DNSSEC. A DNSSEC resolver test can be found here.

Edit to add:
Even SingTel DNS can pass the tests. Just tested with SingTel mobile network.

202.166.1.59 ad202.166.1.59.magix.com.sg. Singtel Fibre Broadband Singapore, Singapore
202.166.1.60 ad202.166.1.60.magix.com.sg. Singtel Fibre Broadband Singapore, Singapore
202.166.1.61 ad202.166.1.61.magix.com.sg. Singtel Fibre Broadband Singapore, Singapore
202.166.108.59 ad202.166.108.59.magix.com.sg. Singtel Fibre Broadband Singapore
202.166.108.60 ad202.166.108.60.magix.com.sg. Singtel Fibre Broadband Singapore
202.166.108.61 ad202.166.108.61.magix.com.sg. Singtel Fibre Broadband
 
Last edited:

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
nice... setting it up on Windows is also easy and works right out of the box. The hard part is probably to remember open up port 80, 53 and 443 in Windows firewall. =:p

1) since the DNS is hosted on a server in a DC, is there any way/workaround to make AdGuard identify the individual clients connecting to it since DHCP is not available on AdGuard itself?

2) Access control list only accepts CIDR or IP addresses, is there any way to make DDNS work since most of us have dynamic IP address? If not then maybe some guru know his way around the API with DNS-O-Matic. https://dnsomatic.com/docs/api

1) I think it is not possible. The same applies for Pi-Hole. It will report everything in the local home network as one client (public IP).

2) No idea here if you are using dynamic IP. Hopefully some experts may chime in to help. But FYI the free tier of Google Cloud provide static public IP.

Edit to add: what do you mean exactly by Access Control list here?

Do you mean the home IP address range? Usually it does not change often as long as you do not reboot the ONT/router combination.

In the case of Pi-hole on cloud, it is recommended to use /16 to cast wider ranges of IP address in the firewall rules. But it may be a bit more difficult if you are with SingTel as they have lots of IPv4 address range. So we have to update the firewall rules when it is changed. I had to do this when I was playing with changing the main router to another router and changed back. I got three IP address, all in different IP ranges.
 
Last edited:

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
Adguard Home seems to require higher memory:

I got the following prompt for f1 micro server.
***
This instance has had high memory utilization recently. Consider switching to the machine type: g1-small (1 vCPU, 1.7 GB memory). Learn more

Current machine type
f1-micro (1 vCPU, 0.6 GB memory)

New machine type
g1-small (1 vCPU, 1.7 GB memory) Recommended Customize
***
 

Hafi

Arch-Supremacy Member
Joined
Mar 30, 2003
Messages
15,340
Reaction score
5,351
1) I think it is not possible. The same applies for Pi-Hole. It will report everything in the local home network as one client (public IP).

looks like I have to step up my game here as I noticed some chinese gov.cn domain in my query log so I've to set up another instance with DHCP within my local network to pinpoint exactly which device client is doing that. :eek:

This maybe leads to having some kind of 2 step redundancy setup, one serving traffic to DoH, DoT while the other with DHCP capability will serve devices without DoH function. The 2 instances will also sync in real time the configuartion file so that block lists and filter rules will update as and when it happens to either one of the instance. Not sure how well this setup works, will give it an experimental run. :o

1)
2) Edit to add: what do you mean exactly by Access Control list here?

Do you mean the home IP address range? Usually it does not change often as long as you do not reboot the ONT/router combination.

In the case of Pi-hole on cloud, it is recommended to use /16 to cast wider ranges of IP address in the firewall rules. But it may be a bit more difficult if you are with SingTel as they have lots of IPv4 address range. So we have to update the firewall rules when it is changed. I had to do this when I was playing with changing the main router to another router and changed back. I got three IP address, all in different IP ranges.

yeap... most of us are using dynamic IP which changes itself after a period of time or router restart unless you subscribe to static IP as an additional VAS. I am on M1 so not sure if its feasible to get their IP ranges and chuck them into the Access control list. DNS-O-Matic will update the IP for you (available as DDNS function in all ASUS routers) but they do not support Adguard or pi-hole yet. Not sure if its possible to DIY using their API to update, might need coding sexperts to take a look.
 

Hafi

Arch-Supremacy Member
Joined
Mar 30, 2003
Messages
15,340
Reaction score
5,351
Adguard Home seems to require higher memory:

I got the following prompt for f1 micro server.
***
This instance has had high memory utilization recently. Consider switching to the machine type: g1-small (1 vCPU, 1.7 GB memory). Learn more

Current machine type
f1-micro (1 vCPU, 0.6 GB memory)

New machine type
g1-small (1 vCPU, 1.7 GB memory) Recommended Customize
***

my Windows server ram is 4Gb and my DNS blocklists now running close to 7 millions spanning over 50 lists, average processing time is under 20ms and everything still update as fast in the admin console without showing any lag. =:p

The downside is I can't seems to use the server to host my game as it is rejecting all traffic connecting to it. :(


update: my AdGuard memory consumption is at max 1.3Gb.
 
Last edited:

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
I found an interesting issue, if I enable IPv6, DNS Leak will happen (SingTel DNS will come into play).

This looks like a SingTel IPv6 problem to me (6rd, not dual stack).

So I disabled IPv6 from my main router (SingTel "Mesh" router for consumer) now. Anyway I was just testing IPv6 and I do not need it.
 

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
I have tried four instances of installations on the Google cloud.
1) vanilla pi-hole without wireguard on a faster Singapore server, not a free tier instance, using my free US$300 credit which will expire in December

2) vanilla pi-hole using the free tier server in US west region

3) pi-hole with wireguard using the free tier server in US west region, following the guide in this thread.

4) Adguard Home using the free tier server in the US west region

Take note you can use only one instance of free tier server for 24/7 operation, so I am still using my free credit since I have three instances.

No 4 is a failure since Adguard Home required higher amount of RAM.

All three pi-hole instances run smoothly once I removed some dead links.

In the end, I have deleted No 2 and No 4. No 1 instance is also running a V2Ray server (socks 5 proxy) but is under used. So I will remove it as well next month.

Google Cloud now only offers three month free trial for new users except the free tier server. Maybe I will try out Amazon/Microsoft/Oracle free one year cloud trial as well.
 

Hafi

Arch-Supremacy Member
Joined
Mar 30, 2003
Messages
15,340
Reaction score
5,351
after running 2 separate instances of AdGuard Home... one on Windows VPS Server 2019 running DoH/DoT in a SG Datacenter and the other on Windows 10 Pro inside internal LAN, I find that running within internal network is more beneficial and much faster (less than 10ms) provided you can spare another hardware machine to run a Adguard/pi-hole instance but then hosting in a DC also requires monthly subscription free. Yes you can make use of free credits but eventually these credits will expire and you'll need to scramble for a free solution again.
 
Last edited:

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
after running 2 separate instances of AdGuard Home... one on Windows VPS Server 2019 running DoH/DoT in a SG Datacenter and the other on Windows 10 Pro inside internal LAN, I find that running within internal network is more beneficial and much faster (less than 10ms) provided you can spare another hardware machine to run a Adguard/pi-hole instance but then hosting in a DC also requires monthly subscription free. Yes you can make use of free credits but eventually these credits will expire and you'll need to scramble for a free solution again.

Yes I agree it is good to add local severs for better performance.

Still you need to use DDNS service if you want to use outside home. Usually not a problem though.

Also take note Google Free Tier is forever free as long as you live within the limit. Just nice to run pi-hole (with wireguard split tunnel to use outside home) but probably not good for Adguard Home.

****
https://cloud.google.com/free

0.2 vCPU + 0.6 GB RAM f1-micro virtual machine instance per month in one of the following US regions:
Oregon: us-west1
Iowa: us-central1
South Carolina: us-east1

up to 30 GB HDD

5 GB of snapshots storage for backups of your server in the following regions:
Oregon: us-west1
Iowa: us-central1
South Carolina: us-east1
Taiwan: asia-east1
Belgium: europe-west1

1 GB network egress from North America to all region destinations (excluding China and Australia) per month.
 
Last edited:

Hafi

Arch-Supremacy Member
Joined
Mar 30, 2003
Messages
15,340
Reaction score
5,351
here a tip for those who running either AdGuard or pi-hole in their internal network whether on a Windows or Synology NAS and still want the DNS over Https/DoT functionality. The latest Microsoft Edge browser allows you to enable DoH/DoT under privacy setting and gave you 4 service providers to choose. Select Cloudflare and then go over to https://www.cloudflare.com/ssl/encrypted-sni/ and test your connection, you should have Secure DNS, DNSSEC and TLS 1.3 green ticks. Then go back to your local machine which hosts your Adguard/pi-hole and you should still see your client passing traffic through your DNS filtering in the query log. Not sure why or how this works but I found it out after fiddling around with the settings.
 

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
...
yeap... most of us are using dynamic IP which changes itself after a period of time or router restart unless you subscribe to static IP as an additional VAS. I am on M1 so not sure if its feasible to get their IP ranges and chuck them into the Access control list. DNS-O-Matic will update the IP for you (available as DDNS function in all ASUS routers) but they do not support Adguard or pi-hole yet. Not sure if its possible to DIY using their API to update, might need coding sexperts to take a look.

Something for Linux.
https://blog.frankovic.net/2019/01/03/pi-hole-in-azure-virtual-machine/

In the end of the article, there is a shell script as a cron job to check the IP change and then update firewall rules automatically. He still leaves the SSH 22 port open to all though.
 

Hafi

Arch-Supremacy Member
Joined
Mar 30, 2003
Messages
15,340
Reaction score
5,351
Something for Linux.
https://blog.frankovic.net/2019/01/03/pi-hole-in-azure-virtual-machine/

In the end of the article, there is a shell script as a cron job to check the IP change and then update firewall rules automatically. He still leaves the SSH 22 port open to all though.

btw DNS-O-Matic updated their DDNS login method to HTTPS and most older routers which still use non-HTTP will get 301 redirection error unless you run DD-WRT or something else which can specify 443 port or custom https entry field.

those running Windows on DoH/DoT (with domain hostname) can use Cloudflare firewall function to block off non-Singapore traffic by specifying GEO filtering rule if DDNS is not working for them.
 

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
https://github.com/rajannpatel/Pi-H...Tunnel-and-Split-Tunnel-Wireguard-VPN-Configs

Reading the guide again and I think the main reason the author uses wireguard for cloud based installation is to encrypt the DNS traffic. To be able to use it outside home is just a side benefit.

Quoting the author says below.
****
There is no value in setting up DNS over HTTPS or DNS over TLS on a cloud hosted instance, because your DNS requests to the cloud are encrypted by Wireguard.
***

For home based installation, he does suggest to enable DNS over HTTPS.
https://docs.pi-hole.net/guides/dns-over-https/
 
Last edited:

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
Another problem I find is that this Pi-Hole setup conflicts with Android 9/10 private DNS.

If you set up private DNS in Android 9/10, you may not be able to go to Internet. I tested with my Huawei P20 and Huawei Nova 5T.

Private DNS setup guides. The first three can be an alternative to Pi-Hole and Adguard, but with basically no option to customization.

Adguard DNS (with filtering)
https://kb.adguard.com/en/dns/setup...oid version 9+, you,the «Private DNS» section.

Quad9 (with filtering)
https://www.quad9.net/private-dns-quad9-android9/

Cleanbrowsing (with filtering)
https://cleanbrowsing.org/guides/android

Google
https://developers.google.com/speed/public-dns/docs/using

Cloudflair
https://blog.cloudflare.com/enable-private-dns-with-1-1-1-1-on-android-9-pie/
(Take note 1.1.1.2 and 1.1.1.3 are not supported)
 
Last edited:

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
Yet another problem happens on the initial connection with WiFi (Pi-hole settings on the device). This mainly happens on my two Huawei Android 10 phones. Yet there are no issues with the other two Android phones (Oppo R11S Android 7 and Realme 5 Android 10).

It may show that the connection has no Internet connection. Switch to another SSID and then come back to the original SSID will sort out the issue. I think it may have something to do with Huawei. Not so sure why. And I have a secondary DNS (1.1.1.3). Still it occasionally goes to this state.

No problems with iOS (three iPhones plus three iPads at home, for wife and two kids).

Not a big problem though -- I have two wireless SSIDs (both with band steering enabled) at home, one from the main SingTel Mesh router and one from Huawei AX3 Pro. Only I am facing the issues since the other family members typically do not switch between the two SSIDs.

For now I have set the Huawei in router mode (Double NAT) and Pi-Hole DNS / Adguad DNS are set as the primary and secondary DNS in the Huawei router. It does not seem to cause any problems.

The main SingTel Mesh router does not allow changing the DNS, so I set up pi-hole DNS as the primary DNS with 1.1.1.3 or adguard DNS as secondary DNS for the mobile devices. This is where I find issues with Windows and Android.

Screenshot showing the problem with main router

pKTL1ta.jpg
 
Last edited:

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
Just set up an Microsoft Azure Account as well (one year free) but I have not figured out why I can not access the pi-hole GUI even though wireguard and Pi-hole are apparently working on the Ubuntu 18.04 virtual instance.

Before that I set up a free Oracle Cloud account but now it seems to only offer Oracle Linux and not Ubuntu/Debian flavor which I am more comfortable with. Pi-hole installation script does not like Oracle due to SELinux policy.

Edit to add: Oracle offers Ubuntu Linux. I was not selecting the right option. I will delete the Oracle Linux instance and then try Ubuntu 20.04 minimum image.
 
Last edited:

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
Just set up an Microsoft Azure Account as well (one year free) but I have not figured out why I can not access the pi-hole GUI even though wireguard and Pi-hole are apparently working on the Ubuntu 18.04 virtual instance.
...

Very strange. It turns out I need to use Wireguard and then it is possible to access the Web GUI through the internet IP, not the public IP. I think I have not set up the firewall rules correctly. I can not even ping the public IP...

I am following another guide for Azure Pi-hole with Wireguard (through Pi-VPN).
https://joshspicer.com/wireguard-azure
 
Last edited:

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
37,667
Reaction score
12,865
Last edited:
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top