-
-
Save rudymccomb/b1ef5ce58010ac9f23709cf95d0ffd71 to your computer and use it in GitHub Desktop.
Configure hostname script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DOMAIN=noomii.com | |
HOSTNAME=hotfix | |
IPV4='184.73.226.144' | |
# Set the host name | |
hostname $HOSTNAME | |
echo $HOSTNAME > /etc/hostname | |
# Add fqdn to hosts file | |
cat<<EOF > /etc/hosts | |
# This file is automatically genreated by ec2-hostname script | |
127.0.0.1 localhost | |
$IPV4 $HOSTNAME.$DOMAIN $HOSTNAME | |
# The following lines are desirable for IPv6 capable hosts | |
::1 ip6-localhost ip6-loopback | |
fe00::0 ip6-localnet | |
ff00::0 ip6-mcastprefix | |
ff02::1 ip6-allnodes | |
ff02::2 ip6-allrouters | |
ff02::3 ip6-allhosts | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment