Posts

Showing posts from 2022

Linux : Difference between /etc/hosts and /etc/resolv.conf

There are basic files to check for when we get any network related issues, Permissions of these files are very important, even if all the entries are correct, hostnames will not resolve and gives an error no host name found. Read permission is a must to resolve network issues if everything else is correct.   /etc/resolv.conf : Lists nameservers that are used by your host for DNS resolution. If you are using  DHCP , this file is automatically populated with DNS records issued by  DHCP  server. /etc/hosts/ : It is just a static lookup method for resolution. /etc/nsswitch.con f: It defined the order of resolution. Who should it consult first for resolution, a DNS or a host file? For example, if the file has the following configuration  hosts: files dns  then  /etc/hosts  the file will be checked first for resolution, if the domain is still un-resolvable, DNS will then be consulted.

Useful Linux Commands

Here are some useful Linux commands which are useful, It will be updated frequently -  Restart VMware tools /etc/vmware-tools/services.sh restart   Reset user account with failed login attempts pam_tally2 --user=username --reset pam_tally2 -r -u username Start date and time of a linux process ps - eo pid,lstart,cmd TSM backup client status, start, stop, restart # service dsmcad start # service dsmcad stop # service dsmcad restart # service dsmcad statis TSM client home dir. /opt/tivoli/tsm/client/ba/bin/ Top files using high space in current directory  find . -xdev -type f -size +100M -exec du -sh {} ';' | sort -rh | head -n50 Compress a file using gzip gzip -c logfile > /tmp/logfile.gz && > logfile SUSE linux fs extend lvextend -L +1G /dev/mapper/system-lvopt # resize_reiserfs -f /dev/vg01/lvol1 or for btrfs btrfs filesystem resize max /opt # umount /dev/vg01/lvol1 # resize_reiserfs /dev/vg01/lvol1 # mount -treiserfs /dev/vg01/lvol1