Repository navigation
Add omarchy-setup-cloudflare-dns script - #752
Conversation
Addresses issue omacom#745 by providing user choice for DNS configuration. Features: - Makes Cloudflare DNS opt-in instead of forced default - Preserves local development environments with DHCP option - Includes custom DNS configuration support - Provides backup/restore functionality - Follows Omarchy naming conventions Fixes omacom#745
Changes based on maintainer review: - Rename script to omarchy-setup-dns (more generic name) - Remove /usr/local/bin installation (use PATH instead) - Add migration to reset automatic Cloudflare DNS to DHCP - Force DNS on physical interfaces only using systemd-networkd - Exclude docker/virtual interfaces from forced DNS Fixes local development environment issues while making Cloudflare DNS opt-in.
Follow Omarchy backup standards by using timestamped backup files instead of fixed names. Remove restore function since backups now have unpredictable names - users can manually restore if needed. This matches the pattern used in omarchy-refresh-config.
|
We could consider using DNS over TLS for the Cloudflare configuration as I suggested in #696 (my PR will become obsolete with this one). |
Enable opportunistic DNS over TLS when using Cloudflare DNS. This encrypts DNS queries when possible while falling back to regular DNS if TLS isn't available, providing security without breaking compatibility. Thanks to the suggestion in omacom#696 for highlighting this improvement.
Great suggestion! I've just added DNS over TLS support to the script. The implementation:
Your PR #696 helped inform this implementation. The new omarchy-setup-dns script now provides both the flexibility to choose DNS providers AND the security Thanks for the excellent suggestion. This makes the solution more complete and secure by default! |
The DNS servers now include their proper hostnames for certificate validation (cloudflare-dns.com and dns.google). This ensures we're actually talking to the real DNS servers when using encrypted DNS, not some imposter. Completes the implementation suggested in omacom#696.
|
@jdambron I've incorporated DNS over TLS with certificate validation into this PR. The implementation now includes:
Your PR #696 can indeed be closed as this implementation covers the same security improvements. The new omarchy-setup-dns script makes it easy for users to choose between secure Cloudflare DNS or local DHCP for development. It's good to see you are pushing for better security by default! I like this aproach personaly. We'll see what @dhh has to say about it :) |
Clean up old backup files before creating new ones to prevent the accumulation of .bak.* files over time. Keeps only the most recent backup while maintaining the timestamped naming pattern. This ensures the system doesn't get cluttered with countless backup files from repeated script runs.
There was a problem hiding this comment.
@dhh I decided to modify the script so that backup files don't accumulate unnecessarily. Which I think is reasonable. If you have any other comments, let me know. Thanks.
|
I like where this is going, but I need to review it more closely. It's a big implementation. I think we can get away with something significantly smaller. But I've removed forcing DNS changes on everyone for new installs for now. |
Reduced script complexity from 227 to 58 lines while maintaining core functionality. Removed unnecessary backup system and systemd-networkd configuration. Kept essential features: Cloudflare DNS with TLS, DHCP mode, and custom DNS option. Script now follows established Omarchy conventions for simplicity and size.
@dhh You were right about the size - got it down to 58 lines from 227. |
|
Ohhh, much nicer! Thanks for this. Big improvement. |
|
Next step with this is to ensure that all the primary interfaces actually use this setup! Need to ensure that wlan0 and whatever is the non-docker, non-loop ethernet interfaces all respect this. Want to tackle that next? |
Yeah, I'll work on that. |
|
Is there a reason we define the FallbackDNS over using systemd-resolved defaults? (Cloudflare -> Quad9 -> Google) The defaults seem very sensible anyway, and may simplify things a small bit. |
|
@euandeas Good question! I chose to include explicit FallbackDNS for two reasons:
I think keeping explicit control over fallback servers fits with Omarchy's philosophy of being intentional about system configuration rather than relying on implicit defaults. |
|
Makes sense, especially transparency wise. My only thought is that if you are choosing Cloudflare as your DNS of choice, this is likely for the privacy benefits over Google (this may just be my perspective though!), I would then much rather have Quad9 as the default fallback than Google. |
|
@euandeas That's an excellent point about privacy! You're absolutely right. Users choosing Cloudflare over Google likely value privacy, so falling back to Google defeats that purpose. Using Quad9 (9.9.9.9) as fallback would indeed be more consistent with the privacy focused choice. Let me see what @dhh thinks about this. If he agrees, I can update the fallback to use Quad9 instead of Google. |
|
@dhh Done! Network interfaces now properly respect the DNS configuration as you requested. The script configures wlan0 and ethernet interfaces while leaving docker/loop interfaces untouched. |
Replace Google DNS fallback with Quad9 (9.9.9.9, 149.112.112.112) for better privacy consistency. Users choosing Cloudflare likely value privacy, so Quad9 is a more appropriate fallback than Google. As discussed in omacom#752 and approved by @dhh in omacom#1043.
* Add omarchy-setup-cloudflare-dns script Addresses issue omacom#745 by providing user choice for DNS configuration. Features: - Makes Cloudflare DNS opt-in instead of forced default - Preserves local development environments with DHCP option - Includes custom DNS configuration support - Provides backup/restore functionality - Follows Omarchy naming conventions Fixes omacom#745 * Address DHH feedback on DNS configuration script Changes based on maintainer review: - Rename script to omarchy-setup-dns (more generic name) - Remove /usr/local/bin installation (use PATH instead) - Add migration to reset automatic Cloudflare DNS to DHCP - Force DNS on physical interfaces only using systemd-networkd - Exclude docker/virtual interfaces from forced DNS Fixes local development environment issues while making Cloudflare DNS opt-in. * Use timestamped backups and remove restore function Follow Omarchy backup standards by using timestamped backup files instead of fixed names. Remove restore function since backups now have unpredictable names - users can manually restore if needed. This matches the pattern used in omarchy-refresh-config. * Add DNS over TLS support for enhanced security Enable opportunistic DNS over TLS when using Cloudflare DNS. This encrypts DNS queries when possible while falling back to regular DNS if TLS isn't available, providing security without breaking compatibility. Thanks to the suggestion in omacom#696 for highlighting this improvement. * Add certificate validation for DNS over TLS The DNS servers now include their proper hostnames for certificate validation (cloudflare-dns.com and dns.google). This ensures we're actually talking to the real DNS servers when using encrypted DNS, not some imposter. Completes the implementation suggested in omacom#696. * Prevent backup file accumulation Clean up old backup files before creating new ones to prevent the accumulation of .bak.* files over time. Keeps only the most recent backup while maintaining the timestamped naming pattern. This ensures the system doesn't get cluttered with countless backup files from repeated script runs. * Simplify DNS setup script per review feedback Reduced script complexity from 227 to 58 lines while maintaining core functionality. Removed unnecessary backup system and systemd-networkd configuration. Kept essential features: Cloudflare DNS with TLS, DHCP mode, and custom DNS option. Script now follows established Omarchy conventions for simplicity and size. * Allow setup from omarchy-menu * Integrate into Omarchy Menu * Align parameter --------- Co-authored-by: David Heinemeier Hansson <[email protected]>
Replace Google DNS fallback with Quad9 (9.9.9.9, 149.112.112.112) for better privacy consistency. Users choosing Cloudflare likely value privacy, so Quad9 is a more appropriate fallback than Google. As discussed in omacom#752 and approved by @dhh in omacom#1043.
* Add omarchy-setup-cloudflare-dns script Addresses issue omacom#745 by providing user choice for DNS configuration. Features: - Makes Cloudflare DNS opt-in instead of forced default - Preserves local development environments with DHCP option - Includes custom DNS configuration support - Provides backup/restore functionality - Follows Omarchy naming conventions Fixes omacom#745 * Address DHH feedback on DNS configuration script Changes based on maintainer review: - Rename script to omarchy-setup-dns (more generic name) - Remove /usr/local/bin installation (use PATH instead) - Add migration to reset automatic Cloudflare DNS to DHCP - Force DNS on physical interfaces only using systemd-networkd - Exclude docker/virtual interfaces from forced DNS Fixes local development environment issues while making Cloudflare DNS opt-in. * Use timestamped backups and remove restore function Follow Omarchy backup standards by using timestamped backup files instead of fixed names. Remove restore function since backups now have unpredictable names - users can manually restore if needed. This matches the pattern used in omarchy-refresh-config. * Add DNS over TLS support for enhanced security Enable opportunistic DNS over TLS when using Cloudflare DNS. This encrypts DNS queries when possible while falling back to regular DNS if TLS isn't available, providing security without breaking compatibility. Thanks to the suggestion in omacom#696 for highlighting this improvement. * Add certificate validation for DNS over TLS The DNS servers now include their proper hostnames for certificate validation (cloudflare-dns.com and dns.google). This ensures we're actually talking to the real DNS servers when using encrypted DNS, not some imposter. Completes the implementation suggested in omacom#696. * Prevent backup file accumulation Clean up old backup files before creating new ones to prevent the accumulation of .bak.* files over time. Keeps only the most recent backup while maintaining the timestamped naming pattern. This ensures the system doesn't get cluttered with countless backup files from repeated script runs. * Simplify DNS setup script per review feedback Reduced script complexity from 227 to 58 lines while maintaining core functionality. Removed unnecessary backup system and systemd-networkd configuration. Kept essential features: Cloudflare DNS with TLS, DHCP mode, and custom DNS option. Script now follows established Omarchy conventions for simplicity and size. * Allow setup from omarchy-menu * Integrate into Omarchy Menu * Align parameter --------- Co-authored-by: David Heinemeier Hansson <[email protected]>
Replace Google DNS fallback with Quad9 (9.9.9.9, 149.112.112.112) for better privacy consistency. Users choosing Cloudflare likely value privacy, so Quad9 is a more appropriate fallback than Google. As discussed in omacom#752 and approved by @dhh in omacom#1043.
* Add omarchy-setup-cloudflare-dns script Addresses issue omacom#745 by providing user choice for DNS configuration. Features: - Makes Cloudflare DNS opt-in instead of forced default - Preserves local development environments with DHCP option - Includes custom DNS configuration support - Provides backup/restore functionality - Follows Omarchy naming conventions Fixes omacom#745 * Address DHH feedback on DNS configuration script Changes based on maintainer review: - Rename script to omarchy-setup-dns (more generic name) - Remove /usr/local/bin installation (use PATH instead) - Add migration to reset automatic Cloudflare DNS to DHCP - Force DNS on physical interfaces only using systemd-networkd - Exclude docker/virtual interfaces from forced DNS Fixes local development environment issues while making Cloudflare DNS opt-in. * Use timestamped backups and remove restore function Follow Omarchy backup standards by using timestamped backup files instead of fixed names. Remove restore function since backups now have unpredictable names - users can manually restore if needed. This matches the pattern used in omarchy-refresh-config. * Add DNS over TLS support for enhanced security Enable opportunistic DNS over TLS when using Cloudflare DNS. This encrypts DNS queries when possible while falling back to regular DNS if TLS isn't available, providing security without breaking compatibility. Thanks to the suggestion in omacom#696 for highlighting this improvement. * Add certificate validation for DNS over TLS The DNS servers now include their proper hostnames for certificate validation (cloudflare-dns.com and dns.google). This ensures we're actually talking to the real DNS servers when using encrypted DNS, not some imposter. Completes the implementation suggested in omacom#696. * Prevent backup file accumulation Clean up old backup files before creating new ones to prevent the accumulation of .bak.* files over time. Keeps only the most recent backup while maintaining the timestamped naming pattern. This ensures the system doesn't get cluttered with countless backup files from repeated script runs. * Simplify DNS setup script per review feedback Reduced script complexity from 227 to 58 lines while maintaining core functionality. Removed unnecessary backup system and systemd-networkd configuration. Kept essential features: Cloudflare DNS with TLS, DHCP mode, and custom DNS option. Script now follows established Omarchy conventions for simplicity and size. * Allow setup from omarchy-menu * Integrate into Omarchy Menu * Align parameter --------- Co-authored-by: David Heinemeier Hansson <[email protected]>
Replace Google DNS fallback with Quad9 (9.9.9.9, 149.112.112.112) for better privacy consistency. Users choosing Cloudflare likely value privacy, so Quad9 is a more appropriate fallback than Google. As discussed in omacom#752 and approved by @dhh in omacom#1043.
Addresses issue #745 by providing user choice for DNS configuration.
Features:
Fixes #745