メインコンテンツに移動

DNSするとき

了解した.では,いってみよう.

hostnamectl set-hostname `dig +short -x おまいのIPアドレス`
cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1              localhost localhost.localdomain localhost6
10.249.229.223(おまいのIPアドレス)  h223.229.249.10.1016485.vlan.kuins.net(上で設定したホスト名)
#   うむ.正しく設定されておるな
firewall-cmd --add-service={freeipa-ldap,freeipa-ldaps,dns}  --permanent
firewall-cmd --reload
firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: bond0 enp2s0f0 enp2s0f1
  sources: 
  services: cockpit dhcpv6-client dns freeipa-ldap freeipa-ldaps nfs ssh
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 
# よっしゃ万事おーけーのはずだ
dnf module enable idm:DL1/dns
dnf module install -y idm:DL1/dns
ipa-server-install --unninstall
ipa-server-install --setup-dns
The log file for this installation can be found in /var/log/ipaserver-install.log
This program will set up the IPA Server. This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the NTP client (chronyd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure DNS (bind)   これが新しい!
  * Configure the KDC to enable PKINIT
Server host name [h223.229.249.10.1016485.vlan.kuins.net]:リターン
Please confirm the domain name [229.249.10.1016485.vlan.kuins.net]:リターン(自分で訂正できないので,設定すべきではない) 
Please provide a realm name [229.249.10.1016485.VLAN.KUINS.NET]:リターン
Directory Manager password:いつものいつもの
IPA admin password:いつものいつもの
Do you want to configure DNS forwarders? [yes]:其のとうりでござる.リターン
Following DNS servers are configured in /etc/resolv.conf: 10.224.253.1, 10.224.254.1
Do you want to configure these servers as DNS forwarders? [yes]:イエス!マム!
Do you want to search for missing reverse zones? [yes]:わかんねえからリターン
The IPA Master Server will be configured with:
Hostname:       h223.229.249.10.1016485.vlan.kuins.net
IP address(es): 10.249.229.223
Domain name:    229.249.10.1016485.vlan.kuins.net
Realm name:     229.249.10.1016485.VLAN.KUINS.NET
The CA will be configured with:
Subject DN:   CN=Certificate Authority,O=229.249.10.1016485.VLAN.KUINS.NET
Subject base: O=229.249.10.1016485.VLAN.KUINS.NET
Chaining:     self-signed
BIND DNS server will be configured to serve IPA domain with:
Forwarders:       10.224.253.1, 10.224.254.1
Forward policy:   only
Reverse zone(s):  No reverse zone

いいんじゃねえかよ.

Continue to configure the system with these values? [no]: yes
The following operations may take some minutes to complete.
Please wait until the prompt is returned.

Synchronizing time
No SRV records of NTP servers found and no NTP server or pool address was provided.
Using default chrony configuration.
Attempting to sync time with chronyc.
Time synchronization was successful.
Configuring directory server (dirsrv). Estimated time: 30 seconds
  [1/44]: creating directory server instance
  [2/44]: enabling ldapi
  [3/44]: configure autobind for root
  [4/44]: stopping directory server
  [5/44]: updating configuration in dse.ldif
  [6/44]: starting directory server
  [7/44]: adding default schema
  [8/44]: enabling memberof plugin
  [9/44]: enabling winsync plugin
  [10/44]: configuring replication version plugin
  [11/44]: enabling IPA enrollment plugin
  [12/44]: configuring uniqueness plugin
  [13/44]: configuring uuid plugin
  [14/44]: configuring modrdn plugin
  [15/44]: configuring DNS plugin
  [16/44]: enabling entryUSN plugin
  [17/44]: configuring lockout plugin
  [18/44]: configuring topology plugin
  [19/44]: creating indices
  [20/44]: enabling referential integrity plugin
  [21/44]: configuring certmap.conf
  [22/44]: configure new location for managed entries
  [23/44]: configure dirsrv ccache
  [24/44]: enabling SASL mapping fallback
  [25/44]: restarting directory server
  [26/44]: adding sasl mappings to the directory
  [27/44]: adding default layout
  [28/44]: adding delegation layout
  [29/44]: creating container for managed entries
  [30/44]: configuring user private groups
  [31/44]: configuring netgroups from hostgroups
  [32/44]: creating default Sudo bind user
  [33/44]: creating default Auto Member layout
  [34/44]: adding range check plugin
  [35/44]: creating default HBAC rule allow_all
  [36/44]: adding entries for topology management
  [37/44]: initializing group membership
  [38/44]: adding master entry
  [39/44]: initializing domain level
  [40/44]: configuring Posix uid/gid generation
  [41/44]: adding replication acis
  [42/44]: activating sidgen plugin
  [43/44]: activating extdom plugin
  [44/44]: configuring directory to start on boot
Done configuring directory server (dirsrv).
Configuring Kerberos KDC (krb5kdc)
  [1/10]: adding kerberos container to the directory
  [2/10]: configuring KDC
  [3/10]: initialize kerberos container
  [4/10]: adding default ACIs
  [5/10]: creating a keytab for the directory
  [6/10]: creating a keytab for the machine
  [7/10]: adding the password extension to the directory
  [8/10]: creating anonymous principal
  [9/10]: starting the KDC
  [10/10]: configuring KDC to start on boot
Done configuring Kerberos KDC (krb5kdc).
Configuring kadmin
  [1/2]: starting kadmin 
  [2/2]: configuring kadmin to start on boot
Done configuring kadmin.
Configuring ipa-custodia
  [1/5]: Making sure custodia container exists
  [2/5]: Generating ipa-custodia config file
  [3/5]: Generating ipa-custodia keys
  [4/5]: starting ipa-custodia 
  [5/5]: configuring ipa-custodia to start on boot
Done configuring ipa-custodia.
Configuring certificate server (pki-tomcatd). Estimated time: 3 minutes
  [1/28]: configuring certificate server instance
  [2/28]: exporting Dogtag certificate store pin
  [3/28]: stopping certificate server instance to update CS.cfg
  [4/28]: backing up CS.cfg
  [5/28]: disabling nonces
  [6/28]: set up CRL publishing
  [7/28]: enable PKIX certificate path discovery and validation
  [8/28]: starting certificate server instance
  [9/28]: configure certmonger for renewals
  [10/28]: requesting RA certificate from CA
  [11/28]: setting audit signing renewal to 2 years
  [12/28]: restarting certificate server
  [13/28]: publishing the CA certificate
  [14/28]: adding RA agent as a trusted user
  [15/28]: authorizing RA to modify profiles
  [16/28]: authorizing RA to manage lightweight CAs
  [17/28]: Ensure lightweight CAs container exists
  [18/28]: configure certificate renewals
  [19/28]: configure Server-Cert certificate renewal
  [20/28]: Configure HTTP to proxy connections
  [21/28]: restarting certificate server
  [22/28]: updating IPA configuration
  [23/28]: enabling CA instance
  [24/28]: migrating certificate profiles to LDAP
  [25/28]: importing IPA certificate profiles
  [26/28]: adding default CA ACL
  [27/28]: adding 'ipa' CA entry
  [28/28]: configuring certmonger renewal for lightweight CAs
Done configuring certificate server (pki-tomcatd).
Configuring directory server (dirsrv)
  [1/3]: configuring TLS for DS instance
  [2/3]: adding CA certificate entry
  [3/3]: restarting directory server
Done configuring directory server (dirsrv).
Configuring ipa-otpd
  [1/2]: starting ipa-otpd 
  [2/2]: configuring ipa-otpd to start on boot
Done configuring ipa-otpd.
Configuring the web interface (httpd)
  [1/21]: stopping httpd
  [2/21]: backing up ssl.conf
  [3/21]: disabling nss.conf
  [4/21]: configuring mod_ssl certificate paths
  [5/21]: setting mod_ssl protocol list to TLSv1.0 - TLSv1.2
  [6/21]: configuring mod_ssl log directory
  [7/21]: disabling mod_ssl OCSP
  [8/21]: adding URL rewriting rules
  [9/21]: configuring httpd
Nothing to do for configure_httpd_wsgi_conf
  [10/21]: setting up httpd keytab
  [11/21]: configuring Gssproxy
  [12/21]: setting up ssl
  [13/21]: configure certmonger for renewals
  [14/21]: publish CA cert
  [15/21]: clean up any existing httpd ccaches
  [16/21]: configuring SELinux for httpd
  [17/21]: create KDC proxy config
  [18/21]: enable KDC proxy
  [19/21]: starting httpd
  [20/21]: configuring httpd to start on boot
  [21/21]: enabling oddjobd
Done configuring the web interface (httpd).
Configuring Kerberos KDC (krb5kdc)
  [1/1]: installing X509 Certificate for PKINIT
Done configuring Kerberos KDC (krb5kdc).
Applying LDAP updates
Upgrading IPA:. Estimated time: 1 minute 30 seconds
  [1/10]: stopping directory server
  [2/10]: saving configuration
  [3/10]: disabling listeners
  [4/10]: enabling DS global lock
  [5/10]: disabling Schema Compat
  [6/10]: starting directory server
  [7/10]: upgrading server
  [8/10]: stopping directory server
  [9/10]: restoring configuration
  [10/10]: starting directory server
Done.
Restarting the KDC
Configuring DNS (named)
  [1/11]: generating rndc key file
  [2/11]: adding DNS container
  [3/11]: setting up our zone
  [4/11]: setting up our own record
  [5/11]: setting up records for other masters
  [6/11]: adding NS record to the zones
  [7/11]: setting up kerberos principal
  [8/11]: setting up named.conf
  [9/11]: setting up server configuration
  [10/11]: configuring named to start on boot
  [11/11]: changing resolv.conf to point to ourselves
Done configuring DNS (named).
Restarting the web server to pick up resolv.conf changes
Configuring DNS key synchronization service (ipa-dnskeysyncd)
  [1/7]: checking status
  [2/7]: setting up bind-dyndb-ldap working directory
  [3/7]: setting up kerberos principal
  [4/7]: setting up SoftHSM
  [5/7]: adding DNSSEC containers
  [6/7]: creating replica keys
  [7/7]: configuring ipa-dnskeysyncd to start on boot
Done configuring DNS key synchronization service (ipa-dnskeysyncd).
Restarting ipa-dnskeysyncd
Restarting named
Updating DNS system records
Configuring client side components
This program will set up IPA client.
Version 4.7.1

Using existing certificate '/etc/ipa/ca.crt'.
Client hostname: h223.229.249.10.1016485.vlan.kuins.net
Realm: 229.249.10.1016485.VLAN.KUINS.NET
DNS Domain: 229.249.10.1016485.vlan.kuins.net
IPA Server: h223.229.249.10.1016485.vlan.kuins.net
BaseDN: dc=229,dc=249,dc=10,dc=1016485,dc=vlan,dc=kuins,dc=net

Configured sudoers in /etc/nsswitch.conf
Configured /etc/sssd/sssd.conf
Systemwide CA database updated.
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
SSSD enabled
Configured /etc/openldap/ldap.conf
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Configuring 229.249.10.1016485.vlan.kuins.net as NIS domain.
Client configuration complete.
The ipa-client-install command was successful

==============================================================================
Setup complete
Next steps:
	1. You must make sure these network ports are open:
		TCP Ports:
		  * 80, 443: HTTP/HTTPS
		  * 389, 636: LDAP/LDAPS
		  * 88, 464: kerberos
		  * 53: bind
		UDP Ports:
		  * 88, 464: kerberos
		  * 53: bind
		  * 123: ntp
	2. You can now obtain a kerberos ticket using the command: 'kinit admin'
	   This ticket will allow you to use the IPA tools (e.g., ipa user-add)
	   and the web user interface.
Be sure to back up the CA certificates stored in /root/cacert.p12
These files are required to create replicas. The password for these
files is the Directory Manager password
The ipa-server-install command was successful

サクセスしたッつうてんだから,サクセスしたんだろ?たぶん

本当に動いてんのかあ?

dig www.yahoo.co.jp
.....
edge12.g.yimg.jp. 55 IN A 183.79.217.124
;; Query time: 16 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: 月 12月 02 18:45:36 JST 2019
;; MSG SIZE  rcvd: 116

まぢか.動いている・・・ように見えるぞ.「DNSするとき」設定の場合,外部の組織になんか頼め,的な要求はない.まあ普通に研究室でマイクロクラスター作るときには,このパターンで良い・・・・事前にそういって欲しかった.だれかに・・・

ご丁寧に,次の作業も指導してくれる.

  • firewallようく確認すること
    • ありがとうございます.確認いたしましたー
  • kinit admin というコマンドを打つことで,コマンドラインツールが使えるようになりますぜ
    • やってみた.
      kinit admin
      Password for admin@229.249.10.1016485.VLAN.KUINS.NET:いつものいつもの
      

    ・・・何も起こりませんが,これでいいんですよね.でもおいらはGUIが好きなんだけど.バカだから.

DNSテスト

本当にDNSサーバーを営業しているのか,テストしてみよう. Macでは【システム環境設定】【ネットワーク】をアンロックしてから【詳細】で,こんな感じ:

DNS^REST

自作サーバーだけでもインターネットができるなら,それは, 上で作ったDNSサーバーが稼働しているっていうことです.

でも,そのまんま放置していると,お試しサーバーの電源切った途端にあんたのPCがインターネットできなくなるから注意


では,クライアントノードを追加してみる.