Created
December 29, 2023 02:34
-
-
Save x-magic/fb51667b37b44fdb5e2346b9785badee to your computer and use it in GitHub Desktop.
UDM-SE: Boot script to add custom DNS records in dnsmasq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# We'll plug the overriding configurations into /run/dnsmasq.conf.d/ | |
cat > /run/dnsmasq.conf.d/local_custom_dns.conf <<- 'EOF' | |
# Add an A record to a specific server (i.e. override) | |
address=/double-click.net/127.0.0.1 | |
# Or a SRV record, if needed | |
srv-host=_ldap._tcp.example.com,ldapserver.example.com,389 | |
# You can even add MX records as you wish | |
mx-host=maildomain.com,servermachine.com,50 | |
EOF | |
# Restart dnsmasq so it sees the new conf file | |
kill `cat /run/dnsmasq.pid` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needs this to be bootable. Note
unifios-utilities/on-boot-script
will install CNI stuff and you may not need them. This can be resolved by creating dummy files:or simply install the script manually.