Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
BIND/NAMED and /etc/hosts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gRRosminet
n00b
n00b


Joined: 11 Feb 2006
Posts: 19

PostPosted: Tue May 16, 2006 10:53 am    Post subject: BIND/NAMED and /etc/hosts Reply with quote

Hi,

I've set up a bind server, following the wiki and the forum

on an other PC, I have set /etc/resolv.conf tu use this local DNS server instead of the ones proposed by my provider. the redirection works very well.

On my local network I have multiple machines (let's say A B C and D) and so each one has a /etc/hosts file to see each other by name.

What I would like to do is that my DNS server "shares it's /etc/hosts" file with others machines. How can I do to be able on machine B to execute a "ping D" without having the corresponding line into the B's /etc/hosts file ?

Thanks for your help


Last edited by gRRosminet on Wed Jul 26, 2006 9:23 am; edited 1 time in total
Back to top
View user's profile Send private message
Dizzutch
Guru
Guru


Joined: 09 Nov 2004
Posts: 463
Location: Worcester, MA

PostPosted: Tue May 16, 2006 12:58 pm    Post subject: Reply with quote

That's what the BIND server does, you want to setup a zone for your own network. however, linux will take /etc/hosts over a DNS lookup, so when you verify your BIND zone works (using nslookup) you can get rid of the hosts in /etc/hosts.
_________________
Help the confused! Adopt an unanswered post!
prepend [solved] to your post title when you feel your issue is resolved.
Worcester Judo
Back to top
View user's profile Send private message
gRRosminet
n00b
n00b


Joined: 11 Feb 2006
Posts: 19

PostPosted: Wed Jul 26, 2006 9:21 am    Post subject: Reply with quote

I did switch to dnsmasq but it cannot handle more than 2 DNS servers so I'm trying to comme back to BIND/NAMED server.

It still don't work for me and I can't see why. Resolving a website works well (like www.gentoo.org) but resolving a local PC (ordi1 or ordi1.mynetwork) doesn't work

Copies of my files :
bind version : 9.2.4


/etc/resolv.conf
Code:
domain mynetwork
search mynetwork

# ISP's DNS
nameserver 193.252.19.4
nameserver 193.252.19.3


/etc/hosts
Code:
127.0.0.1       loopback        localhost       localhost.infass
10.1.0.1        ordi1    ordi1.mynetwork
10.1.0.2        ordi2    ordi2.mynetwork
10.1.0.3        ordi3    ordi3.mynetwork
10.1.0.4        ordi4    ordi4.mynetwork


/etc/named.conf
Code:
options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";

        listen-on { 127.0.0.1; 10.1.0.3; };

        allow-recursion { 127.0.0.1; 10.1.0.0/24; };
};
zone "." IN {
        type hint;
        file "named.ca";
};

zone "localhost" IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
        notify no;
};

zone "127.in-addr.arpa" IN {
        type master;
        file "127.zone";
        allow-update { none; };
        notify no;
};


localhost.zone
Code:
$TTL 1W
@       IN      SOA     ns.localhost. root.localhost.  (
                                15     ; Serial
                                3H     ; Refresh
                                15M    ; Retry
                                1W     ; Expiry
                                1D )   ; Minimum
                IN      NS      127.0.0.1
localhost.      IN      A       127.0.0.1


127.zone
Code:
$ORIGIN 127.in-addr.arpa.
$TTL 1W
@              1D IN SOA        localhost. root.localhost. (
                                15     ; Serial
                                3H     ; Refresh
                                15M    ; Retry
                                1W     ; Expiry
                                1D )   ; Minimum
               1D IN NS         localhost.
*              1D IN PTR        localhost.
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Wed Jul 26, 2006 12:00 pm    Post subject: Reply with quote

gRRosminet wrote:

/etc/resolv.conf
Code:
domain mynetwork
search mynetwork

# ISP's DNS
nameserver 193.252.19.4
nameserver 193.252.19.3



Put your own name server up there. Now you may have bind up and running, but it's no good if you don't tell your computer to use it for something... ;)
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
gRRosminet
n00b
n00b


Joined: 11 Feb 2006
Posts: 19

PostPosted: Wed Jul 26, 2006 12:12 pm    Post subject: Reply with quote

/etc/resolv.conf
Code:
domain mynetwork
search mynetwork

# ISP's DNS
nameserver 193.252.19.4
nameserver 193.252.19.3

#local nameserver : ordi3
nameserver 10.1.0.3


Doesn't work too :cry:
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Wed Jul 26, 2006 12:16 pm    Post subject: Reply with quote

Put it as the first one on that nameserver list. And make sure you don't have a daemon called nscd running, it caches the queries and in situations like this can provide some false results.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
gRRosminet
n00b
n00b


Joined: 11 Feb 2006
Posts: 19

PostPosted: Wed Jul 26, 2006 12:22 pm    Post subject: Reply with quote

I did it already, but the result is the whenever it is the first or the third
And there is no nscd daemon on my server, neither my client
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Wed Jul 26, 2006 12:31 pm    Post subject: Reply with quote

Ok. Are those bind zone files completely present here or did you copy-paste just the beginning of them? Because at the moment it seems your zone files are pretty empty without any actual information about your hosts.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
gRRosminet
n00b
n00b


Joined: 11 Feb 2006
Posts: 19

PostPosted: Wed Jul 26, 2006 12:33 pm    Post subject: Reply with quote

they are complete, they are the same as in the forum exemple : https://forums.gentoo.org/viewtopic-t-402251.html

What I would like is to avoid the creation of a zone file "mynetwork.zone"
Back to top
View user's profile Send private message
gRRosminet
n00b
n00b


Joined: 11 Feb 2006
Posts: 19

PostPosted: Thu Jul 27, 2006 8:39 am    Post subject: Reply with quote

any other idea ?
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Thu Jul 27, 2006 8:56 am    Post subject: Reply with quote

Please re-read the thread you posted above. It contains also the actual zone files filled with information about hosts. If you think of it, at the moment you don't have any host related lines in your bind config, so it has no way of knowing what (for example) 10.10.10.3 should translate to. That's my hint. :-)
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
gRRosminet
n00b
n00b


Joined: 11 Feb 2006
Posts: 19

PostPosted: Thu Jul 27, 2006 2:25 pm    Post subject: Reply with quote

Finally I have made what I didn't want : a script synchronizing the /etc/hosts file and zone files for local domain.

If it can help someone, I have done it folowing this tuto (French) : http://valaurea.free.fr/documents/sig11_bind9_2.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum