nscd (Name Service Cache Daemon) daemon provides caching service for the name service requests in Linux. To configure the nscd caching service, edit /etc/nscd.conf To Flush the DNS Cache in Linux server:
Recently I had a request to reduce the swap space and allocate that space to some other LV in one of our server. Below is what I followed and it perfectly worked for me. :)
Make sure you have enough physical memory to hold the swap contents.
Now, turn the swap off:
# swapoff <YOUR_SWAP_PARTITION>
Now check the status
# swapon -s
Then, Use fdisk command:
# fdisk <YOUR_HARDDISK_Where_SWAP_Resides>
List partitions with "p" commandFind Delete your partition with "d" commandCreate a smaller Linux-Swap partition with "n" commandMake sure it is a Linux-Swap partition (type 82) (Change with "t" command)Write partition table with "w" command
Run "partprobe" to update Filesystem table to kernel. (It is very important before proceeding further)
check to make sure swap is turned on
Now you can use your free space to increase space for other Logical volumes (LV).
Use fdisk command to create new partition, then
# pvcreate <NEW_PARTITION_YOU_CREATED>
# vgextend <VG_TO_INCREASE> <YOUR_NEW_PV>
# lvextend -L +SIZE_TO_INCREASE <LV_NAME>
Note: It is extreme importance of syncing and turning the swap off before you change any partitions. If you FORGET TO DO THIS, YOU WILL LOST_DATA!!
To Allow web and ssh connections in IP Tables SSH and web both require out going messages on established tcp connections.
iptables -A OUTPUT -o eth0 -m state –state ESTABLISHED,RELATED -j ACCEPT
Then you need to allow incomming connections on port 80 and 22 and possibly 443
iptables -A INPUT -p tcp -i eth0 –dport 22 –sport 1024:65535 -m state –state NEW -j ACCEPTiptables -A INPUT -p tcp -i eth0 –dport 80 –sport 1024:65535 -m state –state NEW -j ACCEPTiptables -A INPUT -p tcp -i eth0 –dport 443 –sport 1024:65535 -m state –state NEW -j ACCEPT
To allow a DNS server to operate use the following rules (assuming your blocking inbound and outbound in iptables) DNS communicated in to destination port 53 but can come from any port in the upper range. So these rules require a large section of ports to allow access as long as they want to talk to 53.
LazySystemAdmin is a site with 300+ Articles, how-to guides and video tutorials on all things related to System Administration and Technology. This Blog is to share our knowledge and expertise on System Administration and Operating Systems. Stay connected with LazySystemAdmin.