📜 ⬆️ ⬇️

Substitution time.windows.com local ntp-server

Democracy is the art of managing a circus from within a monkey's cage.
Henry Louis Mencken

In large, constantly changing and developing heterogeneous networks, setting the address of the local ntp server on all machines can be a definite problem. In this case, you can use the capabilities of the DNS server BIND and replace the ip-address issued by the request “time.windows.com”.

On the DNS server (using the example of SLES 10), we will create the zone of interest to us as follows:
')
/var/lib/named/master/time.windows.com
  $ TTL 2d                                                                         
 @ IN SOA ns.example.com.  root.ns.example.com.  (           
                                 2009012810;  serial                        
                                 3h;  refresh                       
                                 1h;  retry                         
                                 1w;  expiry                        
                                 1d);  minimum                       
                                                                                
 time.windows.com.  IN NS ns.example.com.                          
                                                                                
 time.windows.com.  IN A 192.168.0.1 
where 192.168.0.1 is the ip-address of the local ntp-server

Add the following lines to the configuration file /etc/named.conf :
  zone "time.windows.com" in {                                                    
     file "master / time.windows.com";                                             
     type master;                                                                
     allow-transfer {acls;  };               
 }; 
where acls are used in the local network ACLs

Reboot Bind:
  rcnamed reload 
If everything is correct, a similar line will appear in the / var / log / messages log :
  May 24 08:17:32 ns named [30279]: zone time.windows.com/IN: loaded serial 2009012810 
Check the result on the client machine before resetting the dns cache ( How_do_I_Flush_DNS? ):
  # ping time.windows.com
 PING time.windows.com (192.168.0.1) 56 (84) bytes of data.
 64 bytes from ntp.example.com (192.168.0.1): icmp_seq = 1 ttl = 254 time = 0.896 ms 

Source: https://habr.com/ru/post/60319/


All Articles