From 793a23c859d873cef71a6e79fea896a22dda82a3 Mon Sep 17 00:00:00 2001 From: Hugh Ratsch Date: Thu, 20 Feb 2025 03:21:31 -0600 Subject: [PATCH] updated notes --- src/rhcsa.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/rhcsa.md b/src/rhcsa.md index 30983a8..ac8f4d4 100644 --- a/src/rhcsa.md +++ b/src/rhcsa.md @@ -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\ +``` +