Tuesday, October 18, 2011

How to configure linux dns server step by step guide Example and Implementation

How to configure linux dns server step by step guide Example and Implementation


  • A master DNS server for your domain(s), which stores authoritative records for your domain.
  • A slave DNS server, which relies on a master DNS server for data.
  • A caching-only DNS server, which stores recent requests like a proxy server. It otherwise refers to other DNS servers.
  • A forwarding-only DNS server, which refers all requests to other DNS servers.

Before configuring BIND to create a DNS server, you must understand some basic DNS concepts.

The entire hostname with its domain such as server.example.com is called a fully qualified domain name (FQDN). The right-most part of the FQDN such as .com or .net is called the top level domain, with the remaining parts of the FQDN, which are separated by periods, being sub-domains.

These sub-domains are used to divide FQDNs into zones, with the DNS information for each zone being maintained by at least one authoritative name server.

The authoritative server that contains the master zone file, which can be modified to update DNS information about the zone, is called the primary master server, or just master server.

The additional name servers for the zone are called secondary servers or slave servers. Secondary servers retrieve information about the zone through a zone transfer from the master server or from another secondary server. DNS information about a zone is never modified directly on the secondary server

chroot features

chroot feature is run named as user named, and it also limit the files named can see. When installed, named is fooled into thinking that the directory /var/named/chroot is actually the root or / directory. Therefore, named files normally found in the /etc directory are found in /var/named/chroot/etc directory instead, and those you would expect to find in /var/named are actually located in /var/named/chroot/var/named.

The advantage of the chroot feature is that if a hacker enters your system via a BIND exploit, the hacker's access to the rest of your system is isolated to the files under the chroot directory and nothing else. This type of security is also known as a chroot jail.

Configure dns server

In this example we will configure a dns server and will test from client side.

For this example we are using three systems one linux server one linux clients and one window clients.

bind and caching-nameserver rpm is required to configure dns. check them for install if not found install them.
rpm
set hostname to server.example.com and ip address to 192.168.0.254
set hostname and ipaddress

main configuration file for dns server is named.conf. By default this file is not created in /var/named/chroot/etc/ directory. Instead of named.conf a sample file /var/named/chroot/etc/named.caching-nameserver.conf is created. This file is use to make a caching only name server. You can also do editing in this file after changing its name to named.conf to configure master dns server or you can manually create a new named.conf file.

In our example we are creating a new named.conf file
vi named

We are using bind's chroot features so all our necessary files will be located in chroot directory. Set directory location to /var/named. Further we will set the location of forward zone and reverse lookup zone files. If you cannot create this file manually then download this file and copy to /var/named/chroot/etc/

To download do right click here and choose save link As..
named.conf

Or do editing exactly as shown here in image
named.conf
save this file with :wq and exit

Configure zone file

We have defined two zone files example.com.zone for forward zone and 0.168.192.in-addr.arpa for reverse zone. These files will be store in /var/named/chroot/var/named/ location. We will use two sample files for creating these files.

Change directory to /var/named/chroot/var/named and copy the sample files to name which we have set in named.conf
copy sample files

Now open forward zone file example.com.zone
example.com.zone
By default this file will look like this
forward look up zone file
Change this file exactly as shown in image below
forward lookup zone
If you feel difficulty to modify this file then download this configured file and copy to /var/named/chroot/var/named

To download do right click here and choose save link As..
example.com.zone

Now open reverse lookup zone file 0.168.192.in-addr.arpa
reverse lookup zone
By default this file will look like this
reverse lookup zone
Change this file exactly as shown in image below
reverse lookup zone file configured
If you feel difficulty to modify this file then download this configured file and copy to /var/named/chroot/var/named

To download do right click here and choose save link As..
0.168.192.in-addr.arpa

Now changed the ownership of these zone files to named group
chgrp

Now start the named service
service named restart

If service restart without any error means you have successfully configured master name server in our next article we will learn how to configure salve dns server and test it.

How to configure linux print server step by step guide Example and Implementation

How to configure linux print server step by step guide Example and Implementation


Raw (Model) printer named printer1 is installed and shared on 192.168.0.254. You should install the shared printer on your PC to connect shared printer using IPP Protocols.

Exam question Raw printer named printerx where x is your station number is installed and shared on server1.example.com. Install the shared printer on your PC to connect shared printer using IPP Protocols. Your server is 192.168.0.254.

Before you can use any printer, you first have to install it on a Linux system on your network. To start the Printer Configuration Tool, go to the System menu on the top panel and select Administration, Printing or execute the command system-config-printer.

printer path

If no printers are available for the system, only the Server Settings view is available for selection. If local printers are configured, a Local Printers menu will available.

Install new printer

click New Printer on the toolbar.
new printer
In the dialog window that appears, accept the default queue name or change it to a short, descriptive name that begins with a letter and does not contain spaces. Then select printer from list and click on forward and click on finsh.

spool directories
When your system prints a file, it makes use of special directories called spool directories. The location of the spool directory is obtained from the printer's entry in its configuration file. On Linux, the spool directory is located at /var/spool/cups under a directory with the name of the printer.

print job
A print job is a file to be printed. When you send a file to a printer, a copy of it is made and placed in a spool directory set up for that printer.

classes
CUPS features a way to let you select a group of printers to print a job instead of selecting just one. That way, if one printer is busy or down, another printer can be automatically selected to perform the job. Such groupings of printers are called classes. Once you have installed your printers, you can group them into different classes.

Once you have successfully installed local printer it will show in right pane. and in left pane you can see all administrative options.
printer option

  • To view shared printer on other system Tick mark on first option
  • To share locally attached printer tick mark on second option
  • To allow remote administration of this printer check mark on third option

Tick mark on appropriate option and click on apply
share printer from server

configure window clients

Go on window system and ping from printer server and open internet explorer and give the ip address of server with printer port 631
internet explorer

This will launch CUPS web application click on manage printer
manage printer

now you will see the shared printer on server click on print test page
print test page
A test page will be send on printer server copy this url of printer
copy url

click on start button select printer and fax and click on add new printer. this will launch add new printer wizard click next on welcome screen and select network printer
network printer
On this screen select internet printer and paste the url which you copied from internet explorer
internet printer
Install appropriate driver from list or use have disk option you have drive cd and click next. On next screen set this printer defaults and click on next and finish.
set defaults

Remote administration of print server

Go on linux system and ping from server and click on printing from administration menu
printer path
Now click on go to server
go to printer server
Now give print server ip address
ip address of print server
It will take few minute to connect from server depending on network speed
connecting
Now give root password to connect printer server
root password
you can see all print administrative Manu in right pane Once you have connected with sever
print server options

configure Linux clients

Go on linux system and ping from server and click on printing from administration menu
printer path
Now click on new printer
new printer
Click on forward In the next New Printer screen, select the type of connection to internet printing protocols and in hostname give server ip and printer name in printername
select ipp
select the appropriate model. If multiple drivers are available, select the one most appropriate for your configuration. If you do not want to choose the default and click forward and finish. The main Printer Configuration window should now include the name of your printer.
make default
To print test page click on print test page and a test page will send to print server
print test page

Managing Printers from the Command-Line

The lpadmin command enables you to perform most printer administration tasks from the command-line.

lpadmin

 lpc      To view all known queues lpr      To send print requests to any local print queue lpq      To see the print queue lprm     To delete the jobs of your choice use it  with the job number lp       To print any file. 

lpadmin

How to configure linux vnc server step by step guide Example and Implementation

How to configure linux vnc server step by step guide Example and Implementation


For demonstration purpose we will use two linux systems. Both systems should have graphics installed.

To configure VNC- Server

Boot system in init 5 or graphic mode. vnc-server rpm is required to configure server check it if not found install it.
rpm

now click on preferences from system and select remote desktop
vnc
This will launch a new window where you can set sharing and security for remote desktop
set password on server
Allow other users to view your desktop check this option if you to present your desktop on other computer
Allow other users to control your desktop Check this options if you want to grant permission to control user desktop to other user
In security tab you can set password for the user who want to connect with server [Recommended]

Configure Linux client

Go on client system and ping server. vnc-viewer rpm is required to configure clients
vnc viewer
check it and if not found install

Now select accessories from application menu and click on vnc viewer

vnc viewer

this will launch a window Give vnc server ip in it and click on ok
give ip in vnc vieawer

Once connected it will ask for password Give the password which you set on server
enter password in vnc

On server side it will show a pop up and ask for permission click on allow
grant permission

After getting permission from server side you can use server desktop on client side
use server desktop

How to configure linux samba server step by step guide Example and Implementation

How to configure linux samba server step by step guide Example and Implementation


Exam question There are mixed lots of System running on Linux and Windows OS. Some users are working on Windows Operating System. There is a /data directory on linux server should make available on windows to only vinita should have right to connect with samba server . Configure to make available.

Configure samba server

In this example we will configure a samba server and will transfer files from client side.For this example we are using two systems one linux server one window clients.

per quest of samba server

  • A linux server with ip address 192.168.0.254 and hostname Server
  • A window client with ip address 192.168.0.2 and hostname Client2
  • Updated /etc/hosts file on linux system
  • Running portmap and xinetd services
  • Firewall should be off on server

We have configured all these steps in our pervious article.

necessary configuration for samba server

We suggest you to review that article before start configuration of samba server. Once you have completed the necessary steps follow this guide.

samba rpm is required to configure samba server. check them if not found then install
rpm for samba server

Now check smb, portmap, xinetd service in system service it should be on

 #setup Select System service from list [*]portmap [*]xinetd [*]smb 

Now restart xinetd and portmap and smb service
service restart
To keep on these services after reboot on then via chkconfig command
chkconfig
After reboot verify their status. It must be in running condition
service status

Create a normal user named vinita
useradd

now create /data directory and grant it full permission
mkdir

open /etc/samba/smb.conf main samba configuration files
vi smb.conf
By default name of workgroup is MYGROUP in smb.conf file. you can change it with desire name
workgroup tag
our task is to share data folder for vinita user so go in the end of file and do editing as shown here in this image
share data folder in smb.conf
save file with :wq and exit

Now add vinita user to samba user
smbpasswd
we have made necessary change now on smb service and check it status
service smb status
if you already have on this service then restart it with service smb restart commands.

Client configuration for samba server

Go on windows system and ping samba server, change computer name to client2 and workgroup name to MYGROUP
my computer properties
reboot system after changing workgroup name

After reboot open my network place here you can see samba server [ if not see then click on view workgroup computer in right pane, if still not see then use search button from tool bar and search computer samba server form ip ]
samba server in my network place
First try to login from user nikita she will not successes as nikita have not permission to login
user nikita deny
Now login from user vinita [ give the password which you set with smbpasswd command ]

user vinita

As you can see in image user vinita gets the /data folder which we share from samba server
data folder on widow
Copy some window files in data folder
copy in data folder

Check status on samba server

on samba server you can check runtime status of samba server to check it run smbstatus command
smbstatus
in output you see that one samba shared directory is used on window system