gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Networking

Fri May 19, 2017 8:41 am

there is a file /etc/resolv.conf with first line says: # Generated by resolvconf
Can someone tell me where the process resolvconf gets its data please?
thanks in advance, gabriël

drgeoff
Posts: 9612
Joined: Wed Jan 25, 2012 6:39 pm

Re: Networking

Fri May 19, 2017 10:21 am

Depends if you have specified the RPi using DHCP or you set static parameters in dhcpcd.conf.

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Fri May 19, 2017 1:57 pm

no, I have disabled DHCP. I just have a static IP adress.
my problem is: every time I manually change the /etc/resolv.conf file it is overwritten by resolvconf after reboot;
in my /etc/resolv.conf file I should like to add the entry: search hutte.local

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Networking

Fri May 19, 2017 3:47 pm

Add your entry to /etc/resolvconf.conf like this:
search_domains=hutte.local

Then reboot or run resolvconf -u (as root)

/leo

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Fri May 19, 2017 4:32 pm

thank you very much for your answer.
I added the entry search_domains=hutte.local in the file /etc/resolvconf.conf and after reboot an entry search hutte.local is generated in the file /etc/resolv.conf by resolvconf.
I am sorry to say but the result is the same: I still can't ping to a workstation in the zone hutte.local. (huttewksta001.hutte.local) specified in /etc/bind/forward.zone
nslookup hutte.local gives an error: *** Can't find hutte.local: No answer

but now I am a step closer to the solution; I keep trying...
much appreciated, gabriël

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Networking

Fri May 19, 2017 8:04 pm

The objective of the search directive is to include additional domains to be checked when encountering an unqualified domain name, i.e a hostname without a domain. nslookup huttewksta001 should check the hutte.local domain and return the corresponding ip. However, nslookup hutte.local is pointing to a domain and hence it generates an error.
Where is the dns for hutte.local running (localhost?). If not, it should at least be listed as a nameserver in /etc/resolv.conf.
I fail to see why you would need to specify a forwarder.
One of my rpi's is also running bind for a .local domain and it has these lines in resolvconf.conf:

Code: Select all

name_servers=127.0.0.1
domain=hutte.local
#search_domains=hutte.local
Please note that the domain in the domain directive is searched by default.

/leo

hortimech
Posts: 294
Joined: Wed Apr 08, 2015 5:52 pm

Re: Networking

Sat May 20, 2017 8:07 am

As you only need resolvconf when using dhcp, then what you need is a method of stopping it updating /etc/resolv.conf and there is one ;-)

sudo apt-get purge resolvconf

This will remove resolvconf from your system and what isn't there cannot update anything.

When you come to create /etc/resolv.conf, do not use 'domain' use 'search', you do not set your domain name in /etc/resolv.conf, you set it in /etc/hosts

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Sat May 20, 2017 8:47 am

emgi wrote:The objective of the search directive is to include additional domains to be checked when encountering an unqualified domain name, i.e a hostname without a domain. nslookup huttewksta001 should check the hutte.local domain and return the corresponding ip. However, nslookup hutte.local is pointing to a domain and hence it generates an error.
Where is the dns for hutte.local running (localhost?). If not, it should at least be listed as a nameserver in /etc/resolv.conf.
I fail to see why you would need to specify a forwarder.
One of my rpi's is also running bind for a .local domain and it has these lines in resolvconf.conf:

Code: Select all

name_servers=127.0.0.1
domain=hutte.local
#search_domains=hutte.local
Please note that the domain in the domain directive is searched by default.

/leo
thank you very much for your answer:
I've added the line domain=hutte.local and delete the line search_domains=hutte.local in /etc/resolvconf.conf
after reboot I appeared in /etc/resolv.conf
but I still can't ping to huttewksta001.hutte.local but I now CAN ping to huttewksta001
nevertheless in /etc/bind/forward zone I have an entry huttewksta001 IN A 192.168.0.210
much appreciated
gabriël

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Sat May 20, 2017 9:55 am

I just found out that I CAN ping from my local Raspberry to huttesrv000.hutte.local
but failed to ping to huttewksta001.hutte.local
in /etc/hostname
huttesrv000

in /etc/bind/named.conf.local:
include "/etc/bind/zones.rfc1918";

zone "hutte.local" {
type master;
file "/etc/bind/forward.zone";
allow-update { key rndc-key; };
};
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/reverse.zone";
allow-update { key rndc-key; };
};

in /etc/bind/forward.zone:
$TTL 1D
@ IN SOA huttesrv000.hutte.local. root.huttesrv000.hutte.local. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS huttesrv000.hutte.local.
huttesrv000 IN A 192.168.0.11
huttewksta001 IN A 192.168.0.210

are these files syntax wise correct?
gabriël

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Networking

Sat May 20, 2017 1:37 pm

Each time you make a change to a zone file, don't forget to update the serial number.
According to the listing, this is still at 0. Increase the serial number, run rndc reload and try again.
In my named.conf.local I preserved some of the initial comments. It says:

Code: Select all

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
So you should probably also comment this line out. Otherwise I didn't spot any obvious errors.
Some tips:
When there is an entry in a hosts file, the dns is not queried so you should remove all entries there for troubleshooting.
Be aware of the caching which ocurrs in dns. After a failure, you need to make sure to clear the cache because failed lookups are also stored. When you are not aware of this, it can seriously affect your troubleshooting.
Then verify ip connectivity first -ping the ip instead of the hostname.
Then use your dns and carefully check the error message. 'host not found' is very different from 'host unreachable'!
Use nslookup to verify the contents of the dns.
If this returns the expected result, you can be confident that lookups will work as well.
Goodluck!

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Sat May 20, 2017 3:15 pm

thanks for all the tips you gave me.
I increased serial number in /etc/bind/forward.zone and reverse zone
ran sudo rndc reload: server reload successful
cleared cache: sudo rndc flush

but sadly to no avail: everytime I receive: ping: unknown host huttewksta001.hutte.local
I'm getting a little embarrassed because you put all tht time and effort in trying to help me here but everytime I have to say that it doen't work
much obliged, gabriël

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Networking

Sat May 20, 2017 3:26 pm

No worries!
Can you post the output of:

Code: Select all

nslookup huttewksta001

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Sat May 20, 2017 4:12 pm

[email protected]:~ $ nslookup huttewksta001
Server: 192.168.0.11
Address: 192.168.0.11#53

Name: huttewksta001.hutte.local
Address: 192.168.0.210

[email protected]:~ $ nslookup huttewksta001.hutte.local
Server: 192.168.0.11
Address: 192.168.0.11#53

Name: huttewksta001.hutte.local
Address: 192.168.0.210

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Sat May 20, 2017 5:14 pm

now I am completely lost.
A ping to huttewksta001 from the raspberry gives as results:

[email protected]:~ $ ping huttewksta001
PING huttewksta001.hutte.local (192.168.0.210) 56(84) bytes of data.
64 bytes from huttewksta001.hutte.local (192.168.0.210): icmp_seq=1 ttl=128 time=0.600 ms
64 bytes from huttewksta001.hutte.local (192.168.0.210): icmp_seq=2 ttl=128 time=0.538 ms
64 bytes from huttewksta001.hutte.local (192.168.0.210): icmp_seq=3 ttl=128 time=0.676 ms

but I still can't ping to huttewksta001.hutte.local:
[email protected]:~ $ ping huttewksta001.hutte.local
ping: unknown host huttewksta001.hutte.local

can you do anything with that?
gabriël

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Networking

Sat May 20, 2017 5:59 pm

What happens if you try to ping to huttewksta001.hutte.local. ??
(please note the dot in the end, it is significant)

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Networking

Sat May 20, 2017 7:42 pm

Actually there is something else:
You also need to edit /etc/nsswitch.conf.
Remove the text “[NOTFOUND=return]” as follows:

Code: Select all

hosts:          files dns mdns4_minimal
and comment the original line out (or just change it)

Code: Select all

#hosts:          files mdns4_minimal [NOTFOUND=return] dns
That should fix your problem

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Mon May 22, 2017 6:21 am

It works !!!
I changed the line in /etc/nsswitch.conf like you said and suddenly it works like a charm.
I don't WHAT i've changed.
sorry for the delay in answering your last answer but my daughter and granddaughter were visiting Sunday and my wife would kill me if I were at my computer all day.
I' cant say enough how pleased I am with all the help and effort you put in on this.
much appreciated,
gabriël

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Mon May 22, 2017 6:47 am

I cried too soon victory.
now I can ping to hosts in my LAN, but now I'cant access external sites any longer.

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Mon May 22, 2017 1:40 pm

Now I can access hosts on my local LAN. (ping to huttewksta001.hutte.local works well)
but when I try to access external hosts (e.g. ping or browse to www.raspberry.org) I get an error "unknown host" or "this site can't be reached".
Nevertheless in the file /etc/bind/named.conf I have an entry:
includes "/etc/bind/named.conf.default-zones"
in the file /etc/bind/named.conf.default-zones I have an entry:
zone "." {
type hint;
file "/etc/bind/db.root";
};
in the file /etc/bind/db.root I have all the entries of information on root names
Why doesn't BIND resolve these external names?
thanks for any answers.
gabriël

hortimech
Posts: 294
Joined: Wed Apr 08, 2015 5:52 pm

Re: Networking

Mon May 22, 2017 3:04 pm

Have you set up the 'route' ?

Also, you should never use '.local' as your tld, it is reserved for bonjour (aka Avahi on linux)

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Mon May 22, 2017 3:15 pm

sorry,
I don't know what you mean by setting up the route.
Can you explain please?
thank you,
gabriël

hortimech
Posts: 294
Joined: Wed Apr 08, 2015 5:52 pm

Re: Networking

Mon May 22, 2017 4:31 pm

If your computer doesn't know the gateway to the network then you cannot connect to anything outside the network.

Try running this:

sudo route

You should get something like this:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0

The important line is the one that starts 'default' , it should show your gateway devices ipaddress and also that it is up 'UG' and the device it is using.

If you do not have a similar line, you can add it with:

sudo route add default gw {IP-ADDRESS} {INTERFACE-NAME}

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Mon May 22, 2017 4:50 pm

result of sudo route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0

I did pecify my gateway as 192.168.0.1 (IP address of router) in /etc/network/interfaces

gabriel.rosseel
Posts: 133
Joined: Fri May 05, 2017 8:21 am

Re: Networking

Tue May 23, 2017 9:34 am

Finally, I got it all working!
I started from scracth (reformatting, installing Raspbian, installing BIND) but with a small amount of knowledge of Linux that I hadn't the first time (knowledge was zero).
Maybe it is quitting because I didn't solve the problem.
I would like to thank everyone who helped me.
gabriël

Return to “Beginners”