7,166
edits
(→内部 DNS) |
|||
Line 171: | Line 171: | ||
my_hostname = os.popen("/bin/hostname -s").read().rstrip() | my_hostname = os.popen("/bin/hostname -s").read().rstrip() | ||
# replace the ubuntu hostname in /etc/hosts | # replace the ubuntu hostname in /etc/hosts | ||
mp = {'localipv4' : my_ip, 'hostname' : my_hostname, 'fqdn' : my_fqdn} | mp = {'localipv4' : my_ip, 'hostname' : my_hostname, 'fqdn' : my_fqdn} | ||
t = Template(file="/usr/local/etc/bind/templates/hosts.tmpl", searchList=[mp]) | t = Template(file="/usr/local/etc/bind/templates/hosts.tmpl", searchList=[mp]) |