Code: Select all
sed -e 's/my.domain/leblogger.de/g' -i '' /etc/hosts
sed -e 's/my.domain/leblogg.de/g' -i '' /etc/hosts
echo '93.186.197.144 f329.fuchsia.fastwebserver.de f329' >> /etc/hosts
echo '89.163.221.129 leblogger.de f329' >> /etc/hosts
echo '89.163.221.130 leblogg.de f329' >> /etc/hosts
ifconfig `route -n get -inet 93.186.197.144 | awk '/interface/ {print $2}'` inet | \
awk '/inet / {print $0 | "egrep -v \" 127\"" }' | \
head -n 1 | \
awk '{print $2}' | \
xargs -I % sed 's/IPADDR4/%/g' -i '' /etc/hosts
echo '2001:4ba0:ffff:0147::0 f329.fuchsia.fastwebserver.de f329' >> /etc/hosts
echo '2001:4ba0:ffff:0147::1 leblogger.de f329' >> /etc/hosts
echo '2001:4ba0:ffff:0147::2 leblogg.de f329' >> /etc/hosts
ifconfig `route -n get -inet6 2001:4ba0:ffff:0147::0 | awk '/interface/ {print $2}'` inet6 | \
awk '/inet / {print $0 | "egrep -v \" (fe80|::1)\"" }' | \
head -n 1 | \
awk '{print $2}' | \
xargs -I % sed -e 's/IPADDR6/%/g' -i '' /etc/hosts
Code: Select all
# $FreeBSD: releng/10.1/etc/hosts 109997 2003-01-28 21:29:23Z dbaker $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file. Replace 'leblogger.de' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1 localhost localhost.leblogger.de
127.0.0.1 localhost localhost.leblogger.de
#
# Imaginary network.
#10.0.0.2 myname.leblogger.de myname
#10.0.0.3 myfriend.leblogger.de myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers. Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
93.186.197.144 f329.fuchsia.fastwebserver.de f329
89.163.221.129 leblogger.de f329
89.163.221.130 leblogg.de f329
2001:4ba0:ffff:0147::0 f329.fuchsia.fastwebserver.de f329
2001:4ba0:ffff:0147::1 leblogger.de f329
2001:4ba0:ffff:0147::2 leblogg.de f329