Showing posts with label Linux. Show all posts

Installation d’un serveur WEB sous Linux




Installation d’un serveur WEB sous Linux :



 ________________________________________


Follow us on Facebook


Follow us on Google+


________________________________________








Depuis un Terminal en lance la commande
yum install httpd
Pour installer le service httpd




Après avoir installer le service
En doit créer les fichiers de notre site dans le répertoire
/var/www/html


Après avoir configuré les fichiers de notre site en demarre notre navigateur et en tape localhost
Dans la barre d’adresses
Et en voie notre site web.









Installation d’un serveur FTP sous Linux



Installation d’un serveur FTP sous Linux





 ________________________________________


Follow us on Facebook


Follow us on Google+


________________________________________




En Installe le service avec la commande : 

yum install vsftpd 




En Edite le fichier 


/etc/vsftpd/vsftpd.con

Et en ajoute la ligne
anonymous_enable=NO
Pour ne pas autorisé les utilisateurs non authentifier à utiliser FTP.

En démarre le serveur FTP avec la commende
systemctl start vsftpd.service




En test notre serveur FTP à l’aide de la commande :
 ftp localhost
Authentifions-nous avec un nom d’utilisateur et son mot de passe

En voie le message 230 Login successful Avec une commande ls
En liste les fichiers de notre répertoire.

FTP installation and configuration in linux






FTP installation and configuration in linux :

 

 ________________________________________

Follow us on Facebook

Follow us on Google+

________________________________________

 

 

Introduction:


Increasingly, FTP (File Transfer Protocol) is criticized for its lack of security compared to other transfer protocols secure, as scp. It is still widely used and Fedora provides default vsftpd (Very Secure File Transfer Protocol Daemon) as a server for this protocol.
Like most other FTP (ProFTPD, pure-ftpd), vsftpd runs virtual users, that is to say the ability to create user accounts without them are system users (they are in fact all "mapped" on a user system dedicated to this). The peculiarity is that vsftpd uses PAM for authentication of users. We therefore many authentication options that WFP offers.
This documentation describes a configuration of vsftpd in standalone mode, with user authentication system and virtual users. The login information will be stored in these choices in a database format berkeley, or a mysql database. This documentation has been tested on Fedora 7, Fedora 8, 9 and preview Centos 5.0/5.1, but should work on earlier versions.

 

Connection diagrams :


The following two diagrams are intended to highlight the connection tracking ip_conntrack for these 2 modes to better understand the exchange of data between the server and FTP client, allowing to implement rules for iptables firewall.







The diagrams show the use of two distinct channels:
  •      control channel: it allows the client and server to exchange commands for the protocol, and also identify.
  •      data channel: as the name implies, it is used to exchange data between the two positions. It is on the implementation of this channel differs passive mode and active mode.

Installation :

Preparation and pre-requisite equipment

To install a vsftpd server must have the following:

      Server on Linux / Fedora Core.

     INTERNET access.

     Of disk space for the different areas ftp (anonymous or not) that you want to implement.

Installation packages in the system yum

# yum install vsftpd

verification

Ask RPM to list to verify the installation of packages.
# rpm-qa vsftpd *
vsftpd-2.0.1-5






Configuration :

 


Ihere are a number of configuration options, varying server behavior in very different ways. Reading the man page for vsftpd is indispensable for secure configuration.
The configuration file for vsftpd is in / etc / vsftpd and vsftpd.conf is called. We start from an empty configuration, so we move to the folder, and then rename the file:

$ Su -
# Cd / etc / vsftpd
# Mv vsftpd.conf vsftpd.conf.default

We then create a folder that will contain the user-specific configurations:

# Mkdir vsftpd_user_conf

ftpusers and user_list
These two files have the same purpose: banning users. Indeed it both contain a list of users for which the ftp server will reject any connection. Why two files (with identical content)?

  •      The first (ftpusers) is used in the PAM configuration made ​​default on Fedora and CentOS. A connection to a user, PAM has read this file and if the login is used in this file, the connection is refused.
  •      The second (user_list) is used directly by vsftpd. It can have two uses: either only users in this file have the right to connect or access is always denied.


We do not care to have a list of authorized users (second case), since these will be managed with a base of virtual users. It is therefore unnecessary to have two systems of prohibition. My choice would be to follow the default settings made ​​by CentOS and Fedora, that is to say use PAM, so delete the file user_list unnecessary. And yet this is not the solution I used. In fact there is a small difference in how to reject users. If root (present in both files by default) logs:
  •      First case (ftpusers): the PAM system will not react, and the password will be requested. From there, even if it is correct, WFP will refuse the connection as "root" is present in the ftpusers file.
  •      Second case (user_list) Vsftpd going to react differently. When the login is requested, and the user will type "root", it will cut the connection directly, without even asking the password.C'est une subtilité, mais je préfère ce comportement. Le protocole FTP envoyant les données en clair, cela évite par exemple d'envoyer le mot de passe root pour rien. Je vais donc utiliser le fichier user_list plutôt que ftpusers, même si ce n'est pas le choix par défaut fait pour Fedora et Centos.
# Port d'ecoute listen_port=21 # Banniere de bienvenue ftpd_banner=Bienvenue sur mon ftp perso # Fichier de config PAM pam_service_name=vsftpd # Mode "standalone" listen=YES # Je ne veux pas de connexion anonyme anonymous_enable=Yes # On autorise les connexions des utilisateurs locaux. C'est indispensable # pour que les utilisateurs virtuels (mappes sur un utilisateur local) # puissent se connecter (les "vrais" utilisateurs locaux sont ensuite desactives # avec le fichier user_list local_enable=YES # Fichier de users userlist_file=/etc/vsftpd/user_list # Chargement de la liste userlist_file userlist_enable=YES # On refuse les utilisateurs de la liste userlist_deny=YES # trop restrictif, un utilisateur virtuel pourra ainsi telecharger un fichier meme s'il n'est pas world readable anon_world_readable_only=NO # Refus des commandes influant sur le systeme de fichier (STOR, DELE, RNFR, RNTO, MKD, RMD, APPE and SITE) write_enable=Yes # Refus des droits d'ecriture pour les anonymes (et donc utilisateurs virtuels) par défaut # les autorisations seront données au cas par cas : # pas d'upload anon_upload_enable=NO # pas de creation de repertoire anon_mkdir_write_enable=NO # pas de creation, suppression, renommage de repertoire ... anon_other_write_enable=NO # On fait en sorte que les utilisateurs "guest" (non-anonymes) soient mappés sur le compte local "ftp" guest_enable=YES guest_username=ftp # chroot des utilisateurs chroot_local_user=YES # Nombre maximum de connexion simultanees max_clients=50 # Nombre maximum de connexion venant de la meme IP max_per_ip=4 # Dossier de configuration specifique des utilisateurs user_config_dir=/etc/vsftpd/vsftpd_user_conf # On active le log xferlog_enable=YES Petit résumé :
It listens on port 21
  •      It is standalone
  •      We refuse anonymous users
  •      We accept the system users and virtual users
  •      Virtual users are mapped to the system user "ftp"
  •      Users do not have write permissions by default
  •      They are chrooted to / var / ftp
  •      / etc / vsftpd / vsftpd_user_conf / will file for virtual users configurations
  •      / etc / vsftpd / user_list contain the list of denied users (for which we will not even ask the password)

For greater safety, reduces the rights to the configuration file:

# Chmod 600 / etc / vsftpd / vsftpd.conf


User creation system:


This user owns the files and folders that will create virtual users.
# groupadd ftpclient
# useradd -g ftpclient -d /home/ftpclient ftpclient
# passwd ftpclient
# chown ftpclient:ftpclient /home/ftpclient
# chmod 700 /home/ftpclient 
 

Démarrer le service vsftpd 

Once the configuration file replaced, it restarts the FTP server by typing as root:
# / Etc / init.d / vsftpd start
To start, stop and restart the service, the respective commands are (always superuser):

# service vsftpd start
# service vsftpd restart
# service vsftpd stop


Test server


order
1-Open the prompt
2-Type -> ftp targetMachineIP
I use ftp 192.168.1.5 in this case,
3-type user name and password
I use root root123

if what you provide is true that you are connected!

It is possible to connect to an FTP server using the FTP module content in Internet Explorer or Firefox
To access a server that requires a user name and a password, type the address as follows:
ftp://login:password @ server address

login:
represents the user name
password:
password

Exemple: ftp://ftpclient:ftpclient@menara.ma
ou
Exemple: ftp://ftpclient:ftpclient@192.168.1.5



If your login is correct then you can access your files!






 

FTP installation and configuration in linux :

 

 

 

LDAP Server installation and Configuring directory (OpenLDAP Linux)

 

 

 LDAP  Server installation and Configuring directory (OpenLDAP Linux)

 ________________________________________

Follow us on Facebook

Follow us on Google+

________________________________________

 

Présentation:

LDAP server is a database in which information is recorded in the form of a hierarchical tree.

Vérification :

   rpm -q openldap

suppression:

   rpm -e openldap

 

Installation

 

installation from Computer :

   rpm  -ivh openldap

 

installation from Internet:


    yum install openldap



Configuration:

 

We'll just configure the bare minimum for ldap works. We will come back to finish it later conf

So you have to edit the file / etc / ldap / slapd.conf

find rows

# The base of your directory in database #1
suffix          "blabla"

and replace with

# The base of your directory in database #1
suffix          "dc=domain,dc=net"

By convention we put the same suffix as the dns ldap. As for now we do not have the domain name I took Braveo mdl29

We will activate your account in the ldap admin with the password "password" Note that we keep the good suffix is easier

still in the file / etc / ldap / slapd.conf


rootdn  "cn=admin,dc=domain,dc=net"
rootpw  password

Pabon the password is not clear is terrible we will sha hashed in a console you type

slappasswd -h {sha}

it will ask you the password and reapply

New password: 
Re-enter new password: 


if you put password as the password it should give you

{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=

You copy the line and paste it into the rootpw slapd.conf file after giving

rootdn  "cn=admin,dc=domain,dc=net"
rootpw  {SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=

Well, now you'll have to replace all occurrences or appears "cn = admin, dc = lallal" with "cn = admin, dc = domain, dc = net"

access to attrs=userPassword,shadowLastChange
        by dn="cn=admin,dc=domain,dc=net" write
        by anonymous auth
        by self write
        by * none


which changes the rights to the ldap userPassword for fields and shadowLastChange. admin has full access, it can read and write the owner can also change their own field and finally no access to the rest of the world

and finally we allow everyone to read the ldap


access to *
        by dn="cn=admin,dc=admin,dc=net" write
        by * read


We'll do a little test connection. On the server we will restart the LDAP so that they take into account our changes.

/etc/init.d/slapd restart


then we will do a search in the ldap connecting with the ldap admin account

ldapsearch -D "cn=admin,dc=domain,dc=net" -x -W


There is one but it does not give error. LDAP works

Now we will add fields in ldap. To do this we will modify the schema by adding the latest version of the qmail.schema
It is available at  LDAP

 Must copy it into the directory / etc / ldap / schema.

Then it must be declared in the file / etc / ldap / slapd

after the block is available


# Schema and objectClass definitions
include         /etc/ldap/schema/core.schema
include         /etc/ldap/schema/cosine.schema
include         /etc/ldap/schema/nis.schema
include         /etc/ldap/schema/inetorgperson.schema

Must add a line

include         /etc/ldap/schema/qmail.schema

save and reboot
creating users

well our LDP works but it is empty. We'll fill it with a file in ldif format. for example braveo.ldif

er user here has more information than is needed, but it serves to illustrate the content of a ldap


dn: dc=domain,dc=net
objectClass: organizationalUnit
objectClass: dcobject
dc: mdl29
ou: mdl29


dn: ou=Users,dc=mdl29,dc=net
objectClass: organizationalUnit
ou: Users


dn: ou=groups,dc=mdl29,dc=net
objectClass: organizationalUnit
ou: groups


dn: ou=Fonctions,dc=mdl29,dc=net
objectClass: organizationalUnit
ou: Fonctions


dn: ou=Associations,dc=mdl29,dc=net
objectClass: organizationalUnit
ou: Associations

dn: uid=42,ou=Users,dc=mdl29,dc=net
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectclass: qmailuser
mailhost: mail1.mdl29.net
cn: bjensen
displayName: Babs Jensen
sn: Jensen
givenName: Barbara
initials: BJJ
uid: 42
mail: bjensen@mdl29.net
telephoneNumber: +1 408 555 1862
facsimileTelephoneNumber: +1 408 555 1992
mobile: +1 408 555 1941
roomNumber: 0209
carLicense: 6ABC246
o: Siroe
ou: Product Development
departmentNumber: 2604
employeeNumber: 42
employeeType: full time
preferredLanguage: fr, en-gb;q=0.8, en;q=0.7
userPassword: 123456
labeledURI: http://www.siroe.com/users/bjensen My Home Page

must stop ldap

/etc/init.d/slapd stop
 
delete the file ldap
 
rm -rf /var/lib/ldap/*
 
then populate the ldap
 
slapadd -l braveo.ldif 
 
change the permissions on the directory ldap
 
chown -R openldap:openldap /var/lib/ldap/    

ldap start

/etc/init.d/slapd start
 
 
to test

ldapsearch-x-jensen@domain.net mail = bdc = domain, dc = net-h localhost                                               



 LDAP  Server installation and Configuring directory (OpenLDAP Linux)






 





Configuring a Samba Server Linux


 ________________________________________

Follow us on Facebook

Follow us on Google+

________________________________________

Introduction:

Samba is a popular open-source program, which provides file and print services to Microsoft® Windows® clients. With  users, groups, resources are created and managed on a Samba server. As a Linux client, you can use Calculate Linux Desktop or another gentoo-based distribution with the installed calculate-client package. As a Windows client various Windows OSes can be used. To configure the server and the client see Migration to Linux. Any program configured with calculate-server is named "service".
The samba service configures Samba.
This service must be explicitly specified for calculate-server.
Example of adding the test user:
cl-useradd test samba
For users, access rights for server's file resources are the same for Linux and Windows systems.
Samba is included in  Directory Server. If you use another gentoo system, Samba can be installed with portage: just run emerge net-fs/samba.

Configuring the server

 

To configure your server, you should use the calculate-server utilities. Begin by making sure that you have configured the LDAP and the Unix servers.
To configure the Samba server execute:
cl-setup [parameters] samba
Possible parameters are netbios and workgroup.
  • "-n name" sets the NetBIOS name, that will be used by the Samba server. It defaults to the first component of the DNS host name.
  • "-w workgroup" is the domain name or the NT workgroup name, for computers that will access the server.
If the Samba server is a PDC (Primary Domen Controller), you should set the administrator's password, i.e. the password for the admin user.
cl-passwd --smb admin  samba
If you need domain administrator for windows computers, add new user which will be included into domain group "Domain Admins", or include in this group existing user.
The admin user only connects the client Windows machine to the domain and has no home directory.
If you need a domain administrator to manage Windows computers, add a new user that will be added in the domain group "Domain Admins"; an existing user might as well be added to this group.
Example of creating the domain administrator:
cl-useradd -p --gid "Domain Admins" -c "Domain administrator" d_admin samba
If you want to connect Unix clients, set the password for the client service user.
cl-passwd --smb client samba
 

Add and remove users

 

To manage users, the following commands are used: cl-useradd, cl-userdel, cl-usermod, cl-passwd, cl-groupadd, cl-groupdel, cl-groupmod. Their syntax is the same as for the analagous Unix commands.
Instead of smbpasswd, use cl-passwd for changing users' passwords, including the one for the administrator of Windows computers.
Example of adding the test user:
cl-useradd test samba
Example of changing password for the test user:
cl-passwd test samba
Example of adding a user to the primary group Domain Admins:
cl-useradd -g 'Domain Admins' test samba
Note that the samba option is appended to the command.

Set permissions

Setting access rights to the filesystem

To set file permissions on the server, use the ACL (Access Control List). By changing files permissions, you can restrict access to them; this applies both to Windows and Linux clients.
Access rights apply to files as well as to directories. You can specify the permissions on the file's owner or the group. While the Windows client will only recognize the Samba group, the Linux system will display the names of both Unix and Samba groups. Therefore, is preferable to use the Samba group to set access rights.
To create a Samba group, named "manager", type:
cl-groupadd manager samba
To create a Unix group, named "job", execute:
cl-groupadd job unix
Detailed configuration of access rights using ACL is described in "Setting filesystem ACL"

Configuring access rights for Windows users

How to change access rights to shared files on the server is described above.
To configure additional rights on Windows machines, such as: the ability to install programs, to exit the domain, etc., use the Samba group.
Example of granting the test user with the domain administrator rights:
cl-groupmod -a test 'Domain Admins' samba

Structure of Samba groups

Samba groups can be of the following types:
  • Domain Groups (type 2)
  • Local groups (type 4)
  • Built-in groups (type 5)  
Groups created  default
Domain groups


Domain groups are Global groups that operate in the domain.
  • Domain Admins have full access to the domain computers.
  • Domain Guests have minimal rights.
  • Domain Users
  • Domain Computers

Local groups


Local groups are used locally on the computer.
There are no local groups.


Built-in groups


Built-in groups are groups built into the system.
  • Administrators have full rights.
  • Account Operators create and manage user account information, create and manage groups, backup files and directories.
  • Backup Operators backup, restore from a backup, halt the system.
  • Print Operators manage printers and make backups.
  • Replicators. This group is used by FRS File Replication on domain controllers.
  • System Operators change the system time, halt the system, shutdown from a remote system, backup, restore from backup, lock the server or override the server lock, format the hard disk when needed, manage network directories, handle printers.

Creating a Samba group

Creating the domain group test. By default, a domain group is created, group type 2.
cl-groupadd test samba
Creating a built-in group Power Users for users with additional rights:
cl-groupadd -g 547 --rid 547 -t 5 'Power Users' samba
Where:
  • g is the identifier of group 547 (Group ID)
  • rid is the unique identifier 547 (RID)
  • t is the group type 5 (built-in group)
  •  

Viewing information

To view information about users and groups on the server, use the cl-info command:
Listing all unix users:
cl-info -u unix
Listing all samba users:
cl-info -u samba
Getting info about a unix service user:
cl-info -U <user name> unix
Getting info about a samba service user:
cl-info -U <user name> samba
Listing all existing groups for the unix service:
cl-info -g unix
Listing all existing groups for the samba service
cl-info -g samba
Getting info about the unix service group:
cl-info -G <group name> unix
Getting info about the samba service group:
cl-info -G <group name> samba
 
 
 

Configuring a Samba Server Linux (Video)

 
 

 ________________________________________

Follow us on Facebook

Follow us on Google+

________________________________________

 

Installing a DNS server Linux + Video

 ________________________________________

Follow us on Facebook

Follow us on Google+

________________________________________

Présentation:


 DNS (Domain Name System) is used to make the correspondence between the IP address and machine name, it is called name resolution (to resolve into English). More concretely without DNS you would have to directly type the IP addresses of machines on which you want to access (web, ftp, telnet and others). If you are connected to an internet service provider (ISP) intermittently by PPP, ADSL or other, it's usually your ISP's DNS servers that provide name resolution, they usually go in pairs, one finds a primary DNS server and a secondary that is there in case of failure of the first.Now why configuring a DNS server on an isolated post, even on a small network of machines, because it can be used to solve a number of very annoying problems mostly found in off-line mode (not connected to the ISP ) including:- Launch of endless netscape or blocking at boot (for a period of 3min)- Sending mails in the folder waiting for sendmail that lasts more than a minute.But also if you have enabled ipmasquerade to share your Internet connection for your client, a DNS server allows them to surf and use the network tools (telnet, ftp, ...). Assume that your Linux machine, is called myhost and has IP address 192.168.13.10 (your private domain and not assigned by ISP) and your privacy mondomaine.fr. Trees presented (especially in the autostart) are those of a Mandrake (a priori as a RedHat).I will not go into details of the configuration files that you have the DNS-HOWTO (linux section and HOW-TO) which is a good introduction. This page is not intended to substitute for that document, it produces a summary to install a DNS server quickly, for detailed explanations see the HOWTO. It is primarily intended to an isolated post or even a small network connected in a non-permanent Internet.Note: If you do not know the IP addresses of DNS servers of your ISP, if automatic assignment of these addresses, for example, just log in and read the addresses at the nameserver lines.



Installing and configuring the server :


has set up a DNS server requires the installation of two tools bind and named. It concerns a Mandrake packages bind, caching-nameserver and bind-utils.
Linux for a client it will only benefit from the latest package for the host or dig commands. The installation created a file
/ etc / named.conf which is as follows: // generated by named-bootconf.pl

// secret must be the same as in /etc/rndc.conf
key "key" {
        algorithm       hmac-md5;
        secret
"c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
};
controls {
    inet 127.0.0.1 allow { any; } keys { "key"; };
};

options {
        pid-file "/var/run/named/named.pid";
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
};
//
// a caching only nameserver config
//
zone "." {
        type hint;
        file "named.ca";
};
zone "0.0.127.in-addr.arpa" {
        type master;
        file "named.local";
};
On va le modifier pour lire:
// secret must be the same as in /etc/rndc.conf
key "key" {
        algorithm       hmac-md5;
        secret
"c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
};
controls {
    inet 127.0.0.1 allow { any; } keys { "key"; };
};
options {
        pid-file "/var/run/named/named.pid";
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
        // on va mettre ici l'adresses IP des serveurs DNS de vos FAI, votre serveur relaiera les requêtes à ceux-ci
        // s'il n'est pas capable de les résoudre
        forward first;
        forwarders {
                194.149.160.9;
                194.149.160.1;
        };
};
//
// a caching only nameserver config
//
zone "." {
        type hint;
        file "named.ca";
};
zone "0.0.127.in-addr.arpa" {
        type master;
        file "named.local";
};
zone "mondomaine.fr" {
        type master;
        file "mondomaine.fr";
};
 The installation created a directory / var / named containing named.local
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.
1       IN      PTR     localhost.
On le modifiera pour lire:
@       IN      SOA     mamachine.mondomaine.fr. root.mamachine.mondomaine.fr.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      mamachine.mondomaine.fr.
1       IN      PTR     localhost.
On créera sous /var/named un fichier mondomaine.fr contenant:
@       IN      SOA     mamachine.mondomaine.fr. root.mondomaine.fr.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
                                TXT             "mondomaine.fr mon ch'tit domaine"
                NS      mamachine
                                NS              mamachine.mondomaine.fr.
                                MX              10 mamachine
                                MX              20 mamachine.mondomaine.fr.

localhost               A               127.0.0.1
mamachine            A               192.168.13.10
Give this file named group named
chown named:named mondomaine.fr
FYI MX thus corresponds to the SMTP server to your machine if you are running sendmail.
Now in the / etc / nsswitch.conf must have it to the hosts line:

hosts: files dns
The DNS-HOWTO request the creation of a file / etc / host.conf containing
order hosts,bind
multi on

I do not know if it is absolutely necessary, it seems redundant with nsswitch.conf, but just in case.
To complete the / etc / resolv.conf:

search mondomaine.fr
nameserver 127.0.0.1
nameserver 194.149.160.9
nameserver 194.149.160.1
The last two IP addresses are obviously those of your favorite ISP. Note that in the case of an intermittent connection with ppp with automatic assignment of IP addresses of DNS servers, you can not change the last two lines, they are automatically populated when the connection.

Autostart of named

For a server installation on Mandrake, the configuration of the DNS server start automatic installation, you can skip this chapter. The default install of bind and named automatically generates startup files, just in case here are the details. You will find in / etc / rc.d / init.d named file has the following contents:
#!/bin/sh
#
# named           This shell script takes care of starting and stopping
#                 named (BIND DNS server).
#
# chkconfig: 345 55 45
# description: named (BIND) is a Domain Name Server (DNS) \
# that is used to resolve host names to IP addresses.
# probe: true
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/named ] || exit 0
[ -f /etc/named.conf ] || exit 0
# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting named: "
        daemon named
        echo
        touch /var/lock/subsys/named
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down named: "
        killproc named
        rm -f /var/lock/subsys/named
        echo
        ;;
  status)
        /usr/sbin/ndc status
        exit $?
        ;;
  restart)
        /usr/sbin/ndc restart
        exit $?
        ;;
 reload)
        /usr/sbin/ndc reload
        exit $?
        ;;
  probe)
        # named knows how to reload intelligently; we don't want linuxconf
        # to offer to restart every time
        /usr/sbin/ndc reload >/dev/null 2>&1 || echo start
        exit 0
        ;;
  *)
        echo "Usage: named {start|stop|status|restart}"
        exit 1
esac
exit 0
The DNS server is automatically started at power-on state 3, 4 and 5. It will still run after the installation by typing

/etc/rc.d/init.d/named start

To restart named (after a file change), you would type:
/ etc / rc.d / init.d / named restart
The other arguments are start, stop, restart and status.

Client Configuration:


Linux for a client, just create an / etc / resolv.conf containing

domain mondomaine.fr
nameserver 192.168.13.10


You replace it by the address of your server.

Do the same for windows clients, at the Panel and then Network icon.



Function tests:

From a Linux client or server host type the command in a shell, controls typing appear in italics: host -a mamachine
Trying "mamachine.mondomaine.fr"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33741
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;mamachine.mondomaine.fr.             IN      ANY
;; ANSWER SECTION:
mamachine.mondomaine.fr.      86400   IN      A       192.168.25.75
;; AUTHORITY SECTION:
mondomaine.fr.              86400   IN      NS      mamachine.mondomaine.fr.
Received 65 bytes from 127.0.0.1#53 in 15 ms
Then type:
host -a mondomaine.fr
Trying "mondomaine.fr"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47095
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;mondomaine.fr.                     IN      ANY
;; ANSWER SECTION:
mondomaine.fr.              86400   IN      SOA     mamachine.mondomaine.fr. root.mondomaine.fr. 1997022700 28800 14400 3600000 86400
mondomaine.fr.              86400   IN      TXT     "mondomaine.fr mon ch'tit domaine"
mondomaine.fr.              86400   IN      NS      mamachine.mondomaine.fr.
mondomaine.fr.              86400   IN      MX      10 mamachine.mondomaine.fr.
mondomaine.fr.              86400   IN      MX      20 mamachine.mondomaine.fr.
;; ADDITIONAL SECTION:
mamachine.mondomaine.fr.      86400   IN      A       192.168.25.75
Received 179 bytes from 127.0.0.1#53 in 21 ms
Once connected, a client or server type
host -a www.shom.fr
Trying "www.shom.fr."
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12287
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3
;; QUESTION SECTION:
;www.shom.fr.                   IN      ANY
;; ANSWER SECTION:
www.shom.fr.            217813  IN      CNAME   cyclone.shom.fr.
;; AUTHORITY SECTION:
shom.fr.                330241  IN      NS      neree.shom.fr.
shom.fr.                330241  IN      NS      resone.univ-rennes1.fr.
shom.fr.                330241  IN      NS      dns.univ-lyon1.fr.
;; ADDITIONAL SECTION:
dns.univ-lyon1.fr.      317766  IN      A       134.214.100.6
neree.shom.fr.          330241  IN      A       194.57.228.65
resone.univ-rennes1.fr. 300271  IN      A       129.20.254.1
Received 182 bytes from 192.168.25.75#53 in 157 ms

Le ping should work also.

From a position of windows to test your server in a Windows command prompt type
nslookup
At the prompt, type the name of machine under test

>www.shom.fr
Serveur: Unknown
Address: 192.168.26.75
Réponse de source secondaire :
Nom: cyclone.shom.fr
Address: 194.57.228.1
Aliases: www.shom.fr
Type CTRL + C to exit promptly at t

Create virtual hosts

You can create virtual hosts with your DNS server, in other words, your server may be identiifé by several names, it is particularly interesting for apache. With a different name that points to the same machine, however, we can point to different locations.
Suppose we want to create virtual hosts
www.idefix.mondomaine.fr et www.asterix.mondomaine.fr, on rajoutera à la fin du fichier /var/named/mondomaine.fr, the following lines:www.asterix    A    192.168.13.11
www.idefix      A    192.168.13.11
Restart the server by typing:
/etc/rc.d/init.d/named restart
To test a customer type in a shell:
ping www.asterix.mondomaine.fr
It should work.