updated notes
This commit is contained in:
@@ -779,3 +779,55 @@ sudo less /etc/services # Display the services
|
||||
```
|
||||
|
||||
## Manage DNS and Logging
|
||||
|
||||
### resolv.conf
|
||||
```bash
|
||||
sudo nano /etc/resolv.conf # Edit the resolv.conf file
|
||||
|
||||
sudo systemctl restart NetworkManager # Restart the NetworkManager service
|
||||
```
|
||||
|
||||
### nsswitch.conf
|
||||
```bash
|
||||
sudo nano /etc/nsswitch.conf # Edit the nsswitch.conf file
|
||||
|
||||
sudo systemctl restart NetworkManager # Restart the NetworkManager service
|
||||
```
|
||||
|
||||
### query dns
|
||||
```bash
|
||||
dig www.google.com # Query the DNS server for www.google.com
|
||||
|
||||
dig -x 192.168.1.1 # Query the DNS server for the reverse lookup(PTR) of 192.168.1.1
|
||||
|
||||
nslookup www.google.com # Query the DNS server for www.google.com
|
||||
|
||||
nslookup -type=mx gmail.com # Query the DNS server for the MX records for gmail.com
|
||||
```
|
||||
|
||||
### logging
|
||||
```bash
|
||||
sudo journalctl # Display the journal
|
||||
sudo journalctl -xe # Display the journal and show the boot messages
|
||||
sudo journalctl -f # Display the journal and follow the log
|
||||
|
||||
sudo journalctl -u httpd # Display the journal for the httpd service
|
||||
|
||||
sudo journalctl --since "1 hour ago" # Display the journal for the last hour
|
||||
sudo journalctl --since "1 hour ago" --until "2 hour ago" # Display the journal for the last hour and until 2 hours ago
|
||||
```
|
||||
|
||||
### rsyslog
|
||||
```bash
|
||||
sudo nano /etc/rsyslog.conf # Edit the rsyslog configuration file
|
||||
|
||||
sudo systemctl restart rsyslog # Restart the rsyslog service
|
||||
|
||||
sudo systemctl status rsyslog # Display the status of the rsyslog service
|
||||
```
|
||||
|
||||
### logrotate
|
||||
```bash
|
||||
sudo nano /etc/logrotate.conf # Edit the logrotate configuration file\
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user