Linux Basic Learning (15) System failure recovery and DNS service configuration

Source: Internet
Author: User

System failure Recovery

One:
7.0 The boot level after the/usr/lib/systemd/system/******.target/etc/systemd/system/default.target can be changed by linking to the start level
If/etc/systemd/system/default.target is removed and the/usr/lib/systemd/system/reboot.target is linked to Default.target, the system restarts Cannot start
How to resolve:
When entering the system's selection interface, press E to enter the edit mode, remove the kernel configuration to RO, change to RW rd.break and then ctrl+x restart
Reboot will enter the command line, enter chroot/sysroot/into the real root environment, then rm-fr/etc/systemd/system/default.target Delete defaullt, then ln-s/usr/lib/ Systemd/system/graphical.target/etc/systemd/system/default.target to link the graphical interface, it's OK.

Two:
If you forget the root password, you want to change the password:
Also press E to enter the editing interface, the same as RW rd.break,ctrl+x, enter the command line. Chroot/sysroot. Then change the password. Once the modifications are complete, touch/.autorelabel the file and then restarts

Three:
Trouble Tool Kit
Test1: Automatically change root password
Test2: Automatically delete grub boot
TEST3: Removed kernel and grub boot
Remove kernel Solution: Load the virtual optical drive, place the image in the real machine, mount it to the virtual CD drive, set the virtual machine as the CD-ROM boot, enter the system
Select trouble that option, enter rescue mode Chroot/mnt/sysimage and then DF to see if the Sr0 (Sr0 is a virtual CD-ROM), into the directory hanging in the virtual CD-ROM, into the PACKAGE,RPM-IVH kernel3-Brabulabra exit reboot
Remove Boot method Workaround: Set root= ' HD0,MSDOS1 '
linux16/boot/vmlinuz3-Brabalabra ro root=/dev/vda1
initrd16/boot/initramfs3-Bra No pull
Boot
Execute Grub2-mkconfig >/boot/grub2/grub.cfg after entering the system

DNS Cache
Service side:
Yum Install Bind-y
Systemctl Enable named
Systemctl Start named
Firewall-cmd--list-all
Firewall-cmd--permanent-add-service=dns
Firewall-cmd Reload
Netstat-antulpe | grep named
Vim/etc/named.conf
Change 4 configurations
Systemctl Restart named

Client:
Vim/etc/resolv.conf
Write NameServer 172.25.254.201 in it (that's your server-side IP)

Are configured well after dig www.baidu.com

Configuration of the DNS server (forward parsing)
Service side:
Vim/etc/named.rfc1912.zones
Copy and paste the 19th to 24th line in line 25 to modify
Zone "Lcdqqq.com" in {
Type master;
File "Lcdqqq.com.zone";
allow-update {none;};
29};
Vim/var/named
ll
Copy the Named.localhost to lcdqqq.com
Cp-p named.localhost lcdqqq.com (-P: Full replication, even permissions copied)
Enter the file to modify: (4) (in this configuration file to the. End, otherwise auto-lcdqqq.com)
@ in SOA dns.lcdqqq.com. Root.lcdqqq.com. (
0; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
NS dns.lcdqqq.com.
DNS A 172.25.254.201
www A 172.25.254.1
At this point, the client dig www.lcdqqq.com will be connected to 172.25.254.1

Further setup: $TTL 1D
@ in SOA dns.lcdqqq.com. Root.lcdqqq.com. (
0; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
NS dns.lcdqqq.com.
DNS A 172.25.254.201
www A 172.25.254.1
www A 172.25.254.2
LCD CNAME www.lcdqqq.com.
lcdqqq.com. MX 1 172.25.254.101.
Add the last three lines, line 79th, show the DNS polling, line 80th

DNS server configuration (reverse resolution)
Service side:
Vim/etc/named.rfc1912.zones
Copy and paste line 37th to 42nd into line 43 and modify it to:
Zone "254.25.172" in {
The type master;
The file "Lcdqqq.loopback";
allow-update {none;};
47};
Vim/var/named
ll
Copy the Named.loopback to Lcdqqq.loopback
Cp-p named.loopback Lcdqqq.loopback (-P: Full replication, even permissions copied)
Enter the file to modify: (In this configuration file to the. End, otherwise auto-lcdqqq.com)
@ in SOA dns.lcdqqq.com. Root.lcdqqq.com. (
0; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
NS dns.lcdqqq.com.
A 172.25.254.201
1 PTR www.lcdqqq.com.
101 PTR www.hello.com.
At this point, the client Dig-x 172.25.254.1 will be connected to www.lcdqqq.com
Dig-x 172.25.254.101 will be connected to www.hello.com

DNS for internal and external network sensitivity detection:
Modify the etc/name.conf to:
View LocalNet {
match-clients {172.25.254.101;};
Zone "." in {
Type hint;
File "named.ca";
};
Include "/etc/named.rfc1912.zones";
};

View Internet {
match-clients {any;};
Zone "." in {
Type hint;
File "named.ca";
};
Include "/etc/named.rfc1912.zones.inter";
};
Make a copy of/etc/named.rfc1912.zones, named Name.rfc1912.zones.inter.
Copy the Lcdqqq.com.zone to Lcdqqq.com.inter under/var/named
Change all 254 to 0
Copy the Lcdqqq.loopback to Lcdqqq.loopback.inter under/var/named
Change all 254 to 0
Test with 172.25.254.101 and 172.25.254.1, respectively.

Linux Basic Learning (15) System failure recovery and DNS service configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.