리눅스

 

 

 

 

 

 

 

< Sever 컴퓨터 >

[root@localhost ~]# vi /etc/hostname

변경 = >
[root@localhost ~]# vi /etc/hostname
[root@localhost ~]# cat /etc/hostname 
mail.naver.com


[root@localhost ~]# vi /etc/hosts

=>변경

127.0.0.1   localhost localhost.localdomain localhost4
localhost4.localdomain4
::1         localhost localhost.localdomain localhost6
localhost6.localdomain6

192.168.111.100         mail.naver.com


센드메일 설치
[root@localhost ~]# yum -y install sendmail


[root@localhost ~]# vi /etc/mail/local-host-names
변경 =>

# local-host-names - include all aliases for your machine here.

mail.naver.com


[root@localhost ~]# vi /etc/sysconfig/network

변경 =>
# Created by anaconda

HOSTNAME=mail.naver.com


=>재부팅


-----------------------------

-----------------------------

-----------------------------

9장에서 했던 내용 네임 서버 만들기

# yum -y install bind bind-chroot

[root@mail ~]# vi /etc/named.conf
행번호

: set number


변경 =>

     12 options {
     13         listen-on port 53 {  any  ;};
     14         listen-on-v6 port 53 {none ; };
     15         directory       "/var/named";
     16         dump-file       "/var/named/data/cache_dump.db";
     17         statistics-file "/var/named/data/named_stats.txt";
     18         memstatistics-file "/var/named/data/named_mem_stats.txt";
     19         allow-query     {  any; };

    62 zone "naver.com" IN  {
     63 
     64         type master;
     65         file "naver.com.db" ;
     66         allow-update { none; };
     67 
     68 
     69 };
-- INSERT --

zone "naver.com" IN  {

    type master;
    file "naver.com.db" ;
    allow-update { none; };
        

};


zone "daum.net" IN  {

       type master;
       file "daum.net.db" ;
       allow-update { none; };
                 
 
 };

 

 

 

\> 리눅스 명령어
http://hyeonstorage.tistory.com/274


[root@mail ~]# cd /var/named
[root@mail named]# pwd
/var/named
[root@mail named]# ls
centos.com.db  chroot  data  dynamic  named.ca  named.empty  named.localhost
 named.loopback  slaves
[root@mail named]# touch naver.com.db


[root@mail named]# vi naver.com.db

$TTL    3H
@       SOA     @       root.   (       2       1D      1H      1W      1H)
        IN      NS      @
        IN      A       192.168.111.100
        IN      MX      10      mail.naver.com

mail    IN      A       192.168.111.100


카피
[root@mail named]# cp naver.com.db daum.net.db
[root@mail named]# vi daum.net.db
$TTL    3H
@       SOA     @       root.   (       2       1D      1H      1W      1H)
        IN      NS      @
        IN      A       192.168.111.200
        IN      MX      10      mail.daum.com

mail    IN      A       192.168.111.200

확인
[root@mail named]# named-checkconf

[root@mail named]# named-checkzone naver.com naver.com.db
zone naver.com/IN: naver.com/MX 'mail.naver.com.naver.com' has no address
records (A or AAAA)
zone naver.com/IN: loaded serial 2
OK
[root@mail named]# named-checkzone daum.net daum.net.db
zone daum.net/IN: daum.net/MX 'mail.daum.com.daum.net' has no address
records (A or AAAA)
zone daum.net/IN: loaded serial 2
OK


=> 
포트를 여러게 열어야한다. 
그러나 여기서는 테스트이다.
따라서 포트문제로 작동이 안되는 것을 방지 하기위해 방화벽을 중단시킨다.
[root@mail named]# systemctl stop firewalld
[root@mail named]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-
org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.


작동하는지 확인
[root@mail named]# systemctl restart named
[root@mail named]# systemctl enable named
[root@mail named]# systemctl status named
● named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor
preset: disabled)
   Active: active (running) since 수 2017-04-26 18:54:38 KST; 44s ago
 Main PID: 4781 (named)
   CGroup: /system.slice/named.service
           └─4781 /usr/sbin/named -u named

 4월 26 18:54:38 mail.naver.com systemd[1]: Started Berkeley Internet Name
Domain (DNS).
 4월 26 18:54:38 mail.naver.com named[4781]: zone 1.0.0.127.in-addr.arpa/IN:
loaded serial 0
 4월 26 18:54:38 mail.naver.com named[4781]: zone localhost.localdomain/IN:
loaded serial 0
 4월 26 18:54:38 mail.naver.com named[4781]: zone localhost/IN: loaded
serial 0
 4월 26 18:54:38 mail.naver.com named[4781]: zone daum.net/IN: daum.net/MX
'mail.daum.com.daum.net' has no address rec... AAAA)
 4월 26 18:54:38 mail.naver.com named[4781]: zone daum.net/IN: loaded serial
2
 4월 26 18:54:38 mail.naver.com named[4781]: zone naver.com/IN: naver.com/MX
'mail.naver.com.naver.com' has no address... AAAA)
 4월 26 18:54:38 mail.naver.com named[4781]: zone naver.com/IN: loaded
serial 2
 4월 26 18:54:38 mail.naver.com named[4781]: all zones loaded
 4월 26 18:54:38 mail.naver.com named[4781]: running
Hint: Some lines were ellipsized, use -l to show in full.


[root@mail named]# nslookup
> server 192.168.111.100
Default server: 192.168.111.100
Address: 192.168.111.100#53
> mail.naver.com
Server:        192.168.111.100
Address:    192.168.111.100#53

Name:    mail.naver.com
Address: 192.168.111.100
> mail.daum.net
Server:        192.168.111.100
Address:    192.168.111.100#53

Name:    mail.daum.net
Address: 192.168.111.200
> exit

[root@mail named]# cd /etc/sysconfig/network-scripts/
[root@mail network-scripts]# 

[root@mail network-scripts]# ls
ifcfg-ens32 
[root@mail network-scripts]# vi ifcfg-ens32


100 으로 변경 =>
DNSI=192.168.111.100


재시작
#systemctl restart network

# cat /etc/resolv.conf

 

 

 

< 클라이언트 컴퓨터 >

 

[centos@localhost ~]$ su
암호:
[root@localhost centos]# vi /etc/resolv.conf
[root@localhost centos]# 

# Generated by NetworkManager
domain localdomain
search localdomain
nameserver 192.168.111.100

 

 

 

< Server B 컴퓨터 >

 

1. 센드메일 설치
[root@localhost ~]# yum -y install sendmail


2.
[root@localhost ~]# vi /etc/hostname

변경 = >
[root@localhost ~]# vi /etc/hostname
[root@localhost ~]# cat /etc/hostname 
mail.daum.net


3.
[root@localhost ~]# vi /etc/hosts

=>변경

127.0.0.1   localhost localhost.localdomain localhost4
localhost4.localdomain4
::1         localhost localhost.localdomain localhost6
localhost6.localdomain6

192.168.111.200         mail.daum.net

4.
[root@localhost ~]# vi /etc/mail/local-host-names
변경 =>

# local-host-names - include all aliases for your machine here.

mail.daum.net


5. 

[root@localhost ~]# vi /etc/sysconfig/network

변경 =>
# Created by anaconda

HOSTNAME=mail.daum.net


재부팅 reboot

----------------------------------

#cd /etc/sysconfig/network-scripts/

# ls

 

 

 

< win 8  컴퓨터 >


# ipconfig

# netsh interface ip set dns "ethernet0" static 192.168.111.100

# ping mail.daum.net


 

 

 

 

 

 

 

 

 

 

 

about author

PHRASE

Level 60  머나먼나라

일단 기회라고 생각되면 그 기회를 활용하자. -로버트 H. 슐러

댓글 ( 0)

댓글 남기기

작성
  •    
  •    
  •