Update README.md
This commit is contained in:
20
README.md
20
README.md
@@ -13,13 +13,13 @@ However Namecheap charges $50 to interact with their API, and I have heard even
|
||||
Consequently I began to run my own nameservers (ns1/2.tobiastime.xyz) for full autonomy and control over my domain utilizing PowerDNS as the backend
|
||||
|
||||
|
||||
### Dependencies
|
||||
## Dependencies
|
||||
- SSH/SFTP
|
||||
- PowerDNS
|
||||
- Bash
|
||||
|
||||
|
||||
### Prerequisites
|
||||
## Prerequisites
|
||||
|
||||
For security purposes all of my standard ssh keys are password protected
|
||||
|
||||
@@ -29,7 +29,7 @@ Consequently I generated a new SSH key without password protection and linked it
|
||||
|
||||
Said user is appropriately named jaileduser and their sole purpose is to transfer the public IP of my NGINX server to my master nameserver
|
||||
|
||||
#### Set up on the nameserver
|
||||
## Set up on the nameserver
|
||||
|
||||
Create jaileduser as a system user
|
||||
|
||||
@@ -93,7 +93,7 @@ Due to the user having no login shell if the less secure key were ever compromis
|
||||
|
||||
However a user with nologin shell is not able to be used to transfer files with sftp without first making some modifications to the sshd configuration file
|
||||
|
||||
##### Changes to be made in /etc/ssh/sshd_config:
|
||||
### Changes to be made in /etc/ssh/sshd_config:
|
||||
|
||||
```
|
||||
Match User jaileduser
|
||||
@@ -116,7 +116,7 @@ In reference to the above changes
|
||||
|
||||
With all of this done the preliminary steps are complete and we can place the scripts on the nginx server and nameserver
|
||||
|
||||
### Script ran on NGINX server to send public IP to nameserver:
|
||||
## Script ran on NGINX server to send public IP to nameserver:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
@@ -146,7 +146,7 @@ local ip2=$(dig +short myip.opendns.com @resolver1.opendns.com) 2>/dev/null \
|
||||
[ -z "$(cat "$thetext")" ] || scp -i "$keypath" "$thetext" jaileduser@1.2.3.4:/nginx/homeip
|
||||
```
|
||||
|
||||
### Script ran on master nameserver to update DNS records:
|
||||
## Script ran on master nameserver to update DNS records:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
@@ -196,7 +196,7 @@ echo "no action taken due to homeip file being empty at $(date -u)" >> "$bashddn
|
||||
fi
|
||||
```
|
||||
|
||||
### Scheduling automatic execution
|
||||
## Scheduling automatic execution
|
||||
|
||||
Finally we need to schedule these scripts to automatically run using cronjobs
|
||||
|
||||
@@ -222,20 +222,20 @@ On the master nameserver in /etc/crontab place:
|
||||
2 * * * * root /path/to/bashddns/script
|
||||
```
|
||||
|
||||
### Rotating logs
|
||||
## Rotating logs
|
||||
|
||||
Assuming your system has logrotate installed (as most modern distros do
|
||||
|
||||
And you don't want a giant wall of text singular log file for all bashddns actions on the master nameserver
|
||||
|
||||
A log rotate entry can be made as follows:
|
||||
### A log rotate entry can be made as follows:
|
||||
|
||||
```
|
||||
touch /etc/logrotate.d/bashddns
|
||||
nano /etc/logrotate.d/bashddns
|
||||
```
|
||||
|
||||
Insert these configuration options:
|
||||
### Insert these configuration options:
|
||||
|
||||
```
|
||||
/var/log/bashddns.log {
|
||||
|
||||
Reference in New Issue
Block a user