Fresh Information, Great Ideas, Latest Product Review & Specification » Computer & Gadget

Fresh Information, Great Ideas, Latest Product Review & Specification » Home and Appliances

Fresh Information, Great Ideas, Latest Product Review & Specification » Camera & Photography

Saturday, September 18, 2010

How set up virtual server (ubuntu server)

I assume that you have a running DNS server and configured.

First we will change the owner of /var/cache/bind to user:bind and group:bind.

chown bind. /var/cache/bind

We will update the file /etc/bind/named.conf.local and make some few changes. The changes that have been added to the file are highlighted in bold.

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

include "/etc/bind/rndc.key";

controls {
inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; };
};

zone "exx007.lan" {
type master;
file "db.debian.lan";
allow-update { key "rndc-key"; };
};


zone "100.168.192.in-addr.arpa" {
type master;
file "db.192.168.100";
allow-update { key "rndc-key"; };
};

Install and configure dhcp3-server

apt-get install dhcp3-server

vi /etc/default/dhcp3-server

Configure which interface the dhcpd server should listen to. I this case, I assume that our LAN interface is "eth1".

# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp3-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"

Then we will configure the dhcp configuration file, create a backup of the file /etc/dhcp3/dhcpd.conf and edit it.

cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.bak

vi /etc/dhcp3/dhcpd.conf

Make sure the configuration file should be exactly the same like this:

ddns-update-style interim;
ignore client-updates;

include "/etc/bind/rndc.key";

zone exx007.lan. {
primary 127.0.0.1;
key "rndc-key";
}

authoritative;

subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.2 192.168.100.3;
option domain-name-servers 192.168.100.1;
option domain-name "debian.lan";
option routers 192.168.100.1;
default-lease-time 600;
max-lease-time 7200;

zone main.exx007.lan. {
primary 192.168.100.1;
key "rndc-key";
}

zone 100.168.192.in-addr.arpa. {
primary 192.168.100.1;
key "rndc-key";
}
}

Restart the DNS server and the DHCP server.

/etc/init.d/bind9 restart

/etc/init.d/dhcp3-server restart

Your DDNS server should be ok.

Now, if your client in your LAN is Ubuntu, you need to edit the file

/etc/dhcp3/dhclient.conf.

vi /etc/dhcp3/dhclient.conf

Add the following information

send host-name "pc-name";
and run this command to renew your ip address and domain name.
dhclient eth0

Test your client domain name using dig or nslookup command:
nslookup an-an
the command will return the following message:
Server: 192.168.100.1
Address: 192.168.100.1#53

Name: an-an.exx007.lan
Address: 192.168.100.2
Check the reverse dns
nslookup 192.168.100.2
the command will return the following message:
Server: 192.168.100.1
Address: 192.168.100.1#53

2.100.168.192.in-addr.arpa name = an-an.exx007.lan.

Have fun!

No comments:

Post a Comment