Dns
实验环境:2个虚拟机、配置好yum源、检查网络状态
dns server:(192.168.0.210)
1) yum install bind bind-utils bind-libsbind-chroot
2) service named start
3) 修改named配置文件
/var/named/chroot/etc/named.conf
/etc/named.conf
listen-on port53 { any; };
listen-on-v6port 53 { any; };
forwarders {192.168.0.254; };
forward only;
allow-query { any; };
//allow-query { localhost;192.168.0.0/24; };
dnssec-validation no;
4)修改dns配置文件 /etc/resolv.conf
search example.com
nameserver 192.168.0.254
5)修改iptables: tcp、udp 53
client:
1) 修改dns配置文件 /etc/resolv.conf
nameserver 192.168.0.210
测试:
1) hostdemo.example.com
host192.168.0.250
host demo 192.168.0.250
host192.168.0.250 192.168.0.250
host -lexample.com 192.168.0.250
2) nslookup
3) dig
samba:
yum install samba samba-common samba-client
service smb start
修改iptables:
UDP 137,138 TCP 139,445
setsebool -P samba_enable_home_dirs=1
setsebool -P samba_export_all_ro=1
setsebool -P samba_export_all_rw=1
修改smb.conf /etc/samba/smb.conf
share:
[global]
workgroup = MYGROUP
server string = SambaServer Version %v
security = share
[test]
comment = Directory for sharing
path = /tmp/test
read only = yes
guest only = yes
[printers]
comment = All Printers
path =/var/spool/samba
browseable = yes
guest ok = yes
printable = yes
smbclient -L //192.168.1.100
smbclient -L //192.168.1.100 -N
mount -t cifs //192.168.1.100/test /media/
mount -t cifs -o guest //192.168.1.100/test/media/
user:
[global]
workgroup = MYGROUP
server string = Samba Server Version %v
security = user
[homes]
comment = Home Directories
valid users = %S
read only = no
browseable = no
[test]
comment = Directory for testing
path = /tmp/test
force user = leon
force group = leon
guest ok = yes
readonly = no
[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
guest ok = yes
printable = yes
pdbedit -au leon
-L (listall users)
-v
-u (specifyuser)
-a (adduser)
-r (modifyuser)
-x (removeuser)
smbclient -L //192.168.1.100 -U leon
mount -t cifs -o user=leon,password=abc//192.168.1.100/test /media/
fstab:
//192.168.1.100/test /media cifs user=leon,password=abc 0 0
autofs:
smb -fstype=cifs,user=leon,password=abc://192.168.1.100/test
------------------------------------------------------------
server:
/etc/grub.conf->console=ttyS0
client:
minicom -p /dev/pts/1