Script (hostname:hosts:static ip:resolv.conf:bind cache)

#!/bin/bash

#

Setup Basics in Ubuntu 10.04 for Linode.com

by Zach Browne - http://zachbrowne.com

Server zb1

#

UPDATE SERVER

hostname zb1

/etc/init.d/hostname start

ln -sf /usr/share/zoneinfo/US/Central /etc/localtime

aptitude update && aptitude -y safe-upgrade

Setup hosts file

rm /etc/hosts

touch /etc/hosts

cat > /etc/hosts < 127.0.0.1 localhost.localdomain localhost

96.126.124.64 zb1.zachbrowne.com zb1

72.14.178.227 zb2.zachbrowne.com zb2

EOF

Setup static IP

rm /etc/network/interfaces

touch /etc/network/interfaces

cat > /etc/network/interfaces < auto lo

iface lo inet loopback

auto eth0 eth0:1

iface eth0 inet static

address 96.126.124.64

netmask 255.255.255.0

gateway 96.126.124.1

iface eth0:1 inet static

address 192.168.147.82

netmask 255.255.128.0

EOF

Remove DHCP

aptitude -y remove dhcpcd

Add options rotate

rm /etc/resolv.conf

touch /etc/resolv.conf

cat > /etc/resolv.conf < search members.linode.com

nameserver 72.14.188.5

nameserver 72.14.179.5

options rotate

EOF

Install Bind9 to cache DNS.

aptitude -y install bind9

rm /etc/bind/named.conf.options

touch /etc/bind/named.conf.options

cat > /etc/bind/named.conf.options < {

directory "/var/cache/bind";

auth-nxdomain no;

forwarders {69.93.127.10;65.19.178.10;75.127.96.10;207.192.70.10;109.74.194.10;};

listen-on-v6 {any;};

};

EOF

Restart networking

/etc/init.d/networking restart

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct