Skip to content

Commit f9fb975

Browse files
committed
Adding some additional context, fixing some wordings to DNS sinkhole post
1 parent 207d538 commit f9fb975

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

_posts/2024-12-15-creating-a-dns-sinkhole-for-bbb.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ any meta layers that might have them.
115115
> parse the available recipes within your working tree to see if a component
116116
> is available to call. However, I find it to be a bit verbose, so I rarely
117117
> use it. Feel free to experiment by sourcing `oe-init-build-env` and then
118-
> doing something like `bitbake-layers show-recipes | grep <component>`
118+
> doing something like `bitbake-layers show-recipes | grep <component>`.
119119
120120
The first place you should always visit when seeing if recipes exist is the
121121
[Layer Index](https://layers.openembedded.org/layerindex/branch/master/layers/).
@@ -215,7 +215,7 @@ dependencies and add them to the recipe. At least not at the time of writing
215215
this blog post.
216216
217217
The exact area you want to look at is `LAYERDEPENDS` in the `layer.conf` file.
218-
You can see it requires the `core` layer (itself), the `openembedded` layer,
218+
You can see it requires the `core` layer (`meta`), the `openembedded` layer,
219219
and the `meta-python` layer.
220220
221221
To automatically add everything we need, type the following while inside the
@@ -297,7 +297,7 @@ touch recipes-example/dnsmasq-config/files/blocked.list
297297
Populate the `blocked.list` with the following:
298298
299299
```sh
300-
# This file is your blocked list where websites go to DNS la la land
300+
# This file is your blocked list where websites go to DNS La La Land
301301
# Redirect your most hated, least trusted websites to 127.0.0.1 like shown:
302302
127.0.0.1 doubleclick.net
303303
127.0.0.1 ads.facebook.com
@@ -337,8 +337,8 @@ need to make is to have `dnsmasq` look for our newly created `blocked.list`.
337337
In the [`dnsmasq.conf.example`](https://github.com/imp/dnsmasq/blob/master/dnsmasq.conf.example#L141),
338338
there exists a `addn-hosts` section where you can tell `dnsmasq` to look at
339339
another file besides just `/etc/hosts`. We want this because we want `dnsmasq`
340-
to look at our custom `blocked.list` file, so we need to uncomment this.
341-
We also need to make sure we log all `nslookup` entries to a file.
340+
to look at our custom `blocked.list` file, so we need to uncomment this line.
341+
We also need to make sure to log all `nslookup` entries to a file.
342342
We can do all of this with a `.bbappend`, so let's create it:
343343
344344
```sh
@@ -435,8 +435,9 @@ arsort($domainCounts);
435435
436436
// Limit top domains shown
437437
// NOTE: We will use CDNs here. In a truly embedded system, we would be
438-
// placing these files on the disk somewhere and reading from them so we could
439-
// guarantee they would always work with our packaged system.
438+
// placing these files on the rootfs somewhere and reading from them so we
439+
// could guarantee they would always work with our packaged system even when
440+
// disconnected from the internet.
440441
$topDomains = array_slice($domainCounts, 0, 10, true);
441442
?>
442443
<!DOCTYPE html>
@@ -574,7 +575,8 @@ do_install:append() {
574575
> `cgi.fix_pathinfo = 1` to it. I found this wasn't necessary. However, if you
575576
> would like to add it, I found `php-cgi` will see it if you place it in the
576577
> `/usr/bin` directory. Feel free to create a recipe that creates this file and
577-
> places it in that directory if you'd like.
578+
> places it in that directory if you'd like. You can place a `php_%.bbappend`
579+
> in `recipes-devtools/php` in the `meta-bbb` layer.
578580
579581
### 7. Building
580582
@@ -586,14 +588,16 @@ bitbake mycustom-image
586588
```
587589
588590
If everything was successful, you should have a `.wic` located in the `tmp`
589-
directory as mentioned in previous tutorials.
591+
directory as mentioned in previous tutorials. Write this to a MicroSD card
592+
using any of the previous techniques we mentioned in past tutorials.
590593
591594
## Testing the DNS Sinkhole
592595
593-
Insert the MicroSD card, boot, and login. Look up what the IP address is by
594-
typing `ifconfig` and looking at what IP address the BeagleBone Black is
595-
currently set to. On your machine that is connected to the same network as the
596-
BBB, navigate to `http://<BBB-IP-ADDRESS>/index.php`. You should see:
596+
Insert the MicroSD card, boot, and login using `root` with no password.
597+
Look up what the IP address is by typing `ifconfig` and looking at what IP
598+
address the BeagleBone Black is currently set to. On your machine that is
599+
connected to the same network as the BBB, navigate to
600+
`http://<BBB-IP-ADDRESS>/index.php`. You should see:
597601
598602
![Landing Page](/assets/img/2024-12-15/dns-sinkhole-opening-page.png)
599603
@@ -620,7 +624,7 @@ and you should see this:
620624
621625
![Blocked](/assets/img/2024-12-15/dns-sinkhole-blocked.png)
622626
623-
As you continue to attempt to navigate to these sites, this website will
627+
As you continue to attempt to navigate across the web, this PHP website will
624628
continue to parse the `dnsmasq` log and populate it with the latest info.
625629
626630
## Troubleshooting
@@ -650,7 +654,8 @@ that all of your computers automatically send those blocked IPs to the sinkhole,
650654
update your router's DNS settings so that it points to the BeagleBone Black's
651655
IP as the primary DNS server. The Pi-hole website has a
652656
[great example](https://discourse.pi-hole.net/t/how-do-i-configure-my-devices-to-use-pi-hole-as-their-dns-server/245)
653-
on how to do this.
657+
on how to do this. You can customize the front end website by having it be more
658+
dynamic, parse more stats, have a nicer looking GUI, and more!
654659
655660
## Further Reading
656661
@@ -659,5 +664,6 @@ Some useful links that helped me when I first started out:
659664
- [Pi-hole Docs](https://docs.pi-hole.net/main/prerequisites/)
660665
- [dnsmasq on ArchWiki](https://wiki.archlinux.org/title/Dnsmasq)
661666
- [PHP Tutorial](https://www.php.net/manual/en/tutorial.php)
667+
- [Get started with Bootstrap](https://getbootstrap.com/docs/5.2/getting-started/introduction/)
662668
663669
Happy blocking!

0 commit comments

Comments
 (0)