Configuration BIND9 difficile - je nage

Bonjour à toutes et à tous,
J’ai suivi le didactitiel sur l’aide Ubuntu pour créer des noms d’hôtes sur le serveur DNS.
Je suis confus et perdu car cette page d’aide est difficile à comprendre.

J’ai nommé ma machine VAIO-UBUNTU lors de l’installation d’Ubuntu 14.04. Adresse IP = 127.0.0.1
Lorsque je tape l’adresse http://vaio-ubuntu je tombe sur la page d’accueil de Apache, donc c’est bon pour ça.

J’ai paramétré ma carte réseau filaire avec deux adresses IP : 192.168.0.50 et 192.168.0.51.
Je voudrais que dans mon intranet il y ait http://site1 pointant sur 192.168.0.50 et http://site2 pointant sur 192.168.0.51
C’est le but de BIND9 !!!

Il y a beaucoup de fichiers de config pour paramétrer le serveur DNS.

Pouvez-vous m’aider à mettre cela en œuvre ?

Olivier.

J’ajoute le ping que j’ai fait sur l’adresse 192.168.0.50 de la carte réseau :

papa@VAIO-UBUNTU:~$ ping -c 2 192.168.0.50
PING 192.168.0.50 (192.168.0.50) 56(84) bytes of data.

--- 192.168.0.50 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1008ms

Je mettrai mes fichiers de conf DNS demain dans l’espoir que quelqu’un puisse m’aider.

cat /etc/resolv.conf

Bonne soirée.

Olivier.

Bonjour,
Je vous dresse mes fichiers de conf Bind.

/etc/bind/named.conf :

papa@VAIO-UBUNTU:~$ cat /etc/bind/named.conf
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the 
// structure of BIND configuration files in Debian, *BEFORE* you customize 
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

/etc/bind/named.conf.local :

papa@VAIO-UBUNTU:~$ cat /etc/bind/named.conf.local
//
// Do any local configuration here
//

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

zone "VAIO-UBUNTU" {
        type master;
        file "/etc/bind/db.VAIO-UBUNTU";
};

zone "0.168.192.in-addr.arpa" {
        type master;
        notify no;
        file "/etc/bind/db.192";
};

/etc/bind/named.conf.options :

papa@VAIO-UBUNTU:~$ cat /etc/bind/named.conf.options
options {
	directory "/var/cache/bind";

	// If there is a firewall between you and nameservers you want
	// to talk to, you may need to fix the firewall to allow multiple
	// ports to talk.  See http://www.kb.cert.org/vuls/id/800113

	// If your ISP provided one or more IP addresses for stable 
	// nameservers, you probably want to use them as forwarders.  
	// Uncomment the following block, and insert the addresses replacing 
	// the all-0's placeholder.

	#// forwarders {
	#// 	0.0.0.0;
	#// };

	//========================================================================
	// If BIND logs error messages about the root key being expired,
	// you will need to update your keys.  See https://www.isc.org/bind-keys
	//========================================================================
	dnssec-validation auto;

	auth-nxdomain no;    # conform to RFC1035
	listen-on-v6 { ::1; };
};

/etc/bind/db.VAIO-UBUNTU :

papa@VAIO-UBUNTU:~$ cat /etc/bind/db.VAIO-UBUNTU
;
; BIND data file for local loopback interface
;
$TTL	604800
@	IN	SOA	ns.VAIO-UBUNTU admin.VAIO-UBUNTU (
			      4		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@		IN	NS	ns.VAIO-UBUNTU.
NS      	IN      A       10.10.10.10
box     	IN      A       192.168.1.10
infodium     	IN      A       192.168.0.50

Si vous voulez d’autres fichiers de conf, je vous les posterai.
Merci pour votre aide.
Olivier.

J’oubliais mon fichier /etc/resolv.conf :

Il n’y a qu’un seul enregistrement, le problème vient peut être de là, non ?

papa@VAIO-UBUNTU:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1

Olivier.

Bonjour,

Pouvez-vous copier ici le résultat de la commande ifconfig ?

Cordialement,

Voici la réponse de mon ifconfig :

papa@VAIO-UBUNTU:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr f0:bf:97:02:11:b7  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)

lo        Link encap:Boucle locale  
          inet adr:127.0.0.1  Masque:255.0.0.0
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          Packets reçus:872 erreurs:0 :0 overruns:0 frame:0
          TX packets:872 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0 
          Octets reçus:82388 (82.3 KB) Octets transmis:82388 (82.3 KB)

wlan0     Link encap:Ethernet  HWaddr 64:27:37:a6:37:cf  
          inet adr:192.168.1.100  Bcast:192.168.1.255  Masque:255.255.255.0
          adr inet6: fe80::6627:37ff:fea6:37cf/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Packets reçus:20403 erreurs:0 :0 overruns:0 frame:0
          TX packets:2185 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          Octets reçus:4197069 (4.1 MB) Octets transmis:327823 (327.8 KB)

Votre connexion filaire eth0 n’a pas d’adresse, le ping vers 192.168.0.50 ne peut donc pas marcher puisque la seul connexion avec une adresse attribuée est celle en WiFi (192.168.1.100).

Dans votre resolv.conf je vois l’IP 127.0.1.1 comme nameserver, n’auriez-vous pas un service dnsmasq qui tourne déjà ?

Cordialement,

Je ne sais pas au sujet du dnsmasq.

Je suis passé par le panneau de config d’Ubuntu pour attribuer deux adresses IP à mon réseau filaire : 192.168.0.50 et 192.168.0.51

Mon ifconfig niveau eth0 pour la partie inet adr: n’est pas renseigné.

C’est contradictoire.

Y-a-t-il un moyen au niveau du shell d’attribuer des adresses IP à une carte réseau présente dans le système ?

Je commence à devenir vraiment confus dans cette config!

Olivier.

Que retourne la commande ps -aux | grep [d]nsmasq ?

Y a t-il un câble branché sur votre carte réseau ? Si oui il va vers votre box ? Si oui, elle semble se trouver sur le réseau 192.168.1.0/24, alors donner des IP fixes sur le réseau 192.168.0.0/24 va poser problème.

Quelle distribution utilisez-vous ? La documentation du site ubuntu-fr.org est très riche. Je vous conseille de lire tranquillement les pages qui vous sont utiles et de faire vos modifications petit à petit en vous assurant que le réseau fonctionne bien avant de passer à Bind.

Cordialement,

Voici le retour de votre commande :

papa@VAIO-UBUNTU:~$ ps -aux | grep [d]nsmasq nobody 1317 0.0 0.0 35308 3304 ? S 16:03 0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.1.1 --conf-file=/var/run/NetworkManager/dnsmasq.conf --cache-size=0 --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d

J’avais une tour avec une carte réseau non cablée et sous Windows 2000 Server j’avais fait tourner leur serveur DNS, la correspondance Nom d’Hôte <-> Adresse IP fonctionnait pour les adresses IP affectées à la carte réseau (non branchée).

J’avais http://site1, http://site2, …, http://siteN

Si cela peut faire avancer la chose c’est très bien.

Olivier.

Bonjour,
J’ai tenté de suivre le didacticiel de Ubuntu pour Bind9 :
https://doc.ubuntu-fr.org/bind9

Le problème est que c’est relativement compliqué ; j’ai déjà suivi cette page Web et j’ai tenté de modifier
mes fichiers de conf pour Bind9 mais sans succès.

Donc pour revenir à hier, il faut que j’attribue une adresse IP à ma carte réseau (qui n’est pas branchée - Internet par Wifi)
?
Je ne vois pas comment faire ?

Bonjour,

Vous pouvez utiliser le fichier /etc/hosts et les vhosts d’Apache pour faire ce que vous voulez.

Dans /etc/hosts ajouter :

192.168.1.100 site1.tld
192.168.1.100 site2.tld

Et dans /etc/apache2/sites-available/site1 (idem pour site2)

<VirtualHost 192.168.1.100:80>
 ServerName site1.tld
 …
</VirtualHost>

Cordialement,

je rajoute le vhosts dans le fichier :

/etc/apache2/sites-available/site1

et pas dans :

/etc/apache2/sites-available/site1.conf

site1 est un fichier ou un répertoire

?

Merci Matthieu.

J’ai essayé avec mon adresse IP :
192.168.0.50
Ça ne fonctionne pas.

J’ai remis votre adresse IP :
192.168.1.100
et cela fonctionne.

Comment cela se fait-il ?

j’ai créé deux fichiers de conf :

papa@VAIO-UBUNTU:~$ ls -la /etc/apache2/sites-available
total 28
drwxrwxrwx 2 root root 4096 mai   20 12:20 .
drwxrwxrwx 8 root root 4096 mai   20 11:43 ..
-rw-r--r-- 1 root root 1332 janv.  7  2014 000-default.conf
-rw-r--r-- 1 root root 6437 janv.  7  2014 default-ssl.conf
-rw-r--r-- 1 papa papa 1852 mai   20 12:11 infodium.conf
-rw-r--r-- 1 papa papa 1852 mai   20 12:11 philippines.conf

On y est presque !
Quand je vais sur http://infodium j’obtiens la page d’accueil de Apache2 for Ubuntu.
D’après les paramètres ajoutés je devrais avoir la page d’accueil de mon site infodium.

Voici le contenu du répertoire /etc/apache2/sites-available :

papa@VAIO-UBUNTU:~$ ls -la /etc/apache2/sites-available
total 28
drwxrwxrwx 2 root root 4096 mai   20 13:00 .
drwxrwxrwx 8 root root 4096 mai   20 11:43 ..
-rw-r--r-- 1 root root 1332 janv.  7  2014 000-default.conf
-rw-r--r-- 1 root root 6437 janv.  7  2014 default-ssl.conf
-rw-r--r-- 1 papa papa 2175 mai   20 13:00 infodium.conf
-rw-r--r-- 1 papa papa 1852 mai   20 12:11 philippines.conf

et voici le contenu de mon infodium.conf :

papa@VAIO-UBUNTU:~$ cat /etc/apache2/sites-available/infodium.conf
<Directory "/intranet.apache2/">
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>

<Directory "/intranet.apache2/infodium/">
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>

<VirtualHost 192.168.1.100:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.

	ServerName infodium
	ServerAdmin contact@infodium.org
	DocumentRoot /intranet.apache2/infodium

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

    ErrorLog "/MesLogs/Intranet/infodium/error.log"
    CustomLog "/MesLogs/Intranet/infodium/custom.log" combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf

	<IfModule mod_dir.c>
	    DirectoryIndex index.php
	</IfModule>
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

et voici le contenu de mon répertoire /intranet.apache2/infodium (c’est là où se trouvent les fichiers de mon site infodium) :

papa@VAIO-UBUNTU:~$ ls -la /intranet.apache2/infodium
total 160
drwxrwxr-x 20 papa papa  4096 mai   15 14:46 .
drwxrwxrwx 15 root root  4096 mai   15 14:52 ..
drwxrwxr-x  5 papa papa  4096 oct.  15  2013 3ds
drwxrwxr-x  7 papa papa  4096 oct.  15  2013 admin
drwxrwxr-x  5 papa papa  4096 oct.  15  2013 bordeaux
drwxrwxr-x  2 papa papa  4096 oct.  15  2013 chereline
drwxrwxr-x  4 papa papa  4096 oct.  15  2013 classes
drwxrwxr-x  2 papa papa  4096 oct.  15  2013 courrier
drwxrwxr-x  3 papa papa  4096 mai   13 16:09 Duanyan
drwxrwxr-x  2 papa papa  4096 oct.  15  2013 flash3
-rwxrwx---  1 papa papa    32 avril 30  2007 get_defined_functions.php
drwxrwxr-x  3 papa papa  4096 oct.  15  2013 images
drwxrwxr-x  2 papa papa  4096 oct.  15  2013 include
-rwxrwx---  1 papa papa   746 nov.  13  2005 index_entravaux.php
-rwxrwx---  1 papa papa 12657 févr.  4  2008 index.old
-rwxrwx---  1 papa papa 12657 mars  10  2008 index.php
-rwxrwx---  1 papa papa 20780 nov.   4  2005 infodium_accueil.jpg
drwxrwxr-x  3 papa papa  4096 oct.  15  2013 linux
drwxrwxr-x  2 papa papa  4096 oct.  15  2013 music
drwxrwxr-x  3 papa papa  4096 oct.  15  2013 neuf_planetes
drwxrwxr-x  5 papa papa  4096 oct.  15  2013 paris
-rwxrwx---  1 papa papa    18 oct.   5  2005 php4info.php
-rwxrwx---  1 papa papa    21 avril 30  2007 phpinfo.php
drwxrwxr-x  3 papa papa  4096 oct.  15  2013 stellaire
drwxrwxr-x  3 papa papa  4096 oct.  15  2013 telescope
-rwxrwx---  1 papa papa  6656 nov.  23  2011 Thumbs.db
drwxrwxr-x  3 papa papa  4096 oct.  15  2013 vient
drwxrwxr-x  4 papa papa  4096 oct.  15  2013 vrml

Pour accèder à mon site avec cette configuration, il faut tapper http://infodium/infodium.
La solution résolu va sans nul doute tombée !

Olivier.

Et avec cette config, je dois taper :
http://infodium/infodium
Pour accèder à mon site en local.

J’ai un problème de répertoire.

J’ai essayé de mettre mon site dans /var/www/html/infodium et de modifier infodium.conf :

papa@VAIO-UBUNTU:~$ cat /etc/apache2/sites-available/infodium.conf
<Directory "/intranet.apache2/infodium">
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>

<VirtualHost 192.168.1.100:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.

	ServerName infodium
	ServerAdmin contact@infodium.org
	DocumentRoot /intranet.apache2/infodium
	
	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

    ErrorLog "/MesLogs/Intranet/infodium/error.log"
    CustomLog "/MesLogs/Intranet/infodium/custom.log" combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf

	<IfModule mod_dir.c>
	    DirectoryIndex index.php
	</IfModule>
</VirtualHost>