# (open)resolv.conf, DNS and networkmanager?

## benneque

Hey,

I have ~amd64, KDE 4.5.1, knetworkmanager-9999 and networkmanager-0.8.1 installed.

Following questions:

Where can I see which DNS server I am using? Is it /etc/resolv.conf?

Now I have/had the following problem:

without openresolv useflag in networkmanager I set in knetworkmanager DNS server 8.8.8.8 but in /etc/resolv.conf nothing changend, even after resboot...

with operesolv useflag the DNS server entry was written to /etc/resolv.conf

That's ok ... I hope  :Wink:  Tell me!

But now why the hell there is another entry for 192.168.1.1 (my router), I have no entry for that in knetworkmanager ? Using the router as DNS is damn slow!!!

Now the strange thing is: My girlfriend has the same system as me (just a different notebook, and hers is compiled with gcc 4.4 and mine with 4.5) aaaand...

... same config (DNS 8.8.8. :Cool:  in knetworkmanager and in my girlfriends resolv.conf there's no entry for 192.168.1.1 . That's so stupid!

Another question: What is this DNS search thing for? I have an entry for "localdomain" , my girlfriend hasn't. Should I insert there the 8.8.8.8 as well? Or is it stupid?[/code]

Soo.. how can I see where the resolv.conf entrys come from? And how can I change them?

I tried one time to change the entrys by hand inside the file, this broke my ENTIRE network connection (wlan and eth)  :Sad: 

appendix:

my resolv.conf

```
# Generated by resolvconf                                                                                                                                        

search localdomain 8.8.4.4 8.8.8.8                                                                                                                               

nameserver 192.168.1.1                                                                                                                                           

nameserver 8.8.4.4                                                                                                                                               

nameserver 8.8.8.8 
```

girlfriends resolv.conf

```
# Generated by resolvconf                                                                                                                                        

search 8.8.4.4 8.8.8.8                                                                                                                                          

nameserver 8.8.4.4                                                                                                                                               

nameserver 8.8.8.8 
```

----------

## UberLord

 *benneque wrote:*   

> Another question: What is this DNS search thing for? I have an entry for "localdomain" , my girlfriend hasn't. Should I insert there the 8.8.8.8 as well? Or is it stupid?

 

DNS search (and domain) is used to make name lookup easier

```
search foo.com bar.org
```

You could then ping wibble, and it would try wibble.foo.com and then wibble.bar.org.

domain is like search, but only accepts one item.

See reslolv.conf(5) for details.

 *Quote:*   

> Soo.. how can I see where the resolv.conf entrys come from? And how can I change them?
> 
> I tried one time to change the entrys by hand inside the file, this broke my ENTIRE network connection (wlan and eth) 
> 
> 

 

resolvconf -l

will show you the individual resolv.conf files given to it. Hopefully a comment at the top will show you from where it came.

----------

## benneque

resolvconf -l says:

```
# resolv.conf from NetworkManager

# Generated by NetworkManager

search 8.8.4.4 8.8.8.8

nameserver 8.8.4.4

nameserver 8.8.8.8

# resolv.conf from wlan0

# Generated by dhcpcd from wlan0

domain localdomain

nameserver 192.168.1.1
```

so the damn dhcpcd is it! But it's in no runlevel.

Though ... I think networkmanager uses it ?! Or maybe not

How can I prevent it from doing those things?

EDIT: i configured knetworkmanager to get the IP by dhcp, but use the DNS I told it. Same config at my girlfriends notebook

When I type resolvconf -l on her notebook there's no entry from dhcpcd or anything else. just networkmanager!

----------

## benneque

Hi everyone,

I found a way to temporary disable the wrong DNS entry:

"kdesu systemsettings" -> network options and remove the entry.

But I'm still searching for a real solution.

Anyone?  :Smile: 

----------

## vanclan117

So went into this forum because i saw DNS, and the tech guy at school said to get through the firewall at school all i have to do is change my DNS, he said if i can figure out how then he will let me do it when i want... so my question for you guys is how do i change my DNS but stay connected to the school wifi?

----------

## cach0rr0

 *vanclan117 wrote:*   

> So went into this forum because i saw DNS, and the tech guy at school said to get through the firewall at school all i have to do is change my DNS, he said if i can figure out how then he will let me do it when i want... so my question for you guys is how do i change my DNS but stay connected to the school wifi?

 

on a temporary basis? 

change it in /etc/resolv.conf 

it will be overwritten upon reboot, or respawning a dhcp request...but if you just want to change to test things out, change your nameserver line in /etc/resolv.conf to not use the school's DNS servers (e.g. point it at Google's public DNS, as an example)

though that has nothing to do with "getting through the firewall" 

He may mean circumventing content filtering, in which case I suspect he may have deployed OpenDNS

----------

## benneque

Guys!

NEW INFORMATION!!!

rc-status from the two laptops is different:

mine says:

```
Dynamic Runlevel: manual

dhcpcd

net.lo
```

This should be the solution, but I don't know where it comes from  :Sad: 

Help?!

EDIT: now I removed everything (samba, cupsd, ntp, avahi, etc.) that has anything to do with network and the entry is now correct. I will add those things now step by step to see where it comes from  :Smile: 

EDIT2: soo... cupsd, mysql, avahi and ntp won't start dhcpcd. BUT samba and apache2 start it.

On my girlfriends laptop there's also samba in default runlevel and it won't start dhcpcd  :Sad: 

WHY oh WHY ?

----------

## cach0rr0

look at the 'need' and/or 'depend' lines in the init scripts. They should tell you.

----------

## benneque

I looked at it for samba:

On both notebooks there's no need, just depend:

```
after slapd

need net

use cupsd
```

Now I have a really strange samba...

I set it again to default runlevel and it fails to start. the log says: "getaddrinfo failed for name 0.0.0.0"

dhcpcd is loaded (runlevel manual), but I can stop it without stopping any other service.

When I restart samba(/etc/init.d/samba restart) samba does NOT load dhcp and it's starting without any problems.

I'm confused  :Sad: 

----------

## benneque

ARRR SHIT!

Don't kill me!

It was SO simple  :Very Happy:   :Very Happy:   :Very Happy: 

```
rc-update add net.lo boot
```

shame on me!

----------

## vanclan117

 *cach0rr0 wrote:*   

> He may mean circumventing content filtering, in which case I suspect he may have deployed OpenDNS

 

Im pretty sure he is using OpenDNS.. so how do i get around the blocked sites?

----------

## cach0rr0

 *vanclan117 wrote:*   

>  *cach0rr0 wrote:*   He may mean circumventing content filtering, in which case I suspect he may have deployed OpenDNS 
> 
> Im pretty sure he is using OpenDNS.. so how do i get around the blocked sites?

 

stop querying OpenDNS's servers  :Smile: 

see: changing resolv.conf

----------

## UberLord

Looks to me like you're using dhcpcd and networkmanager.

This is no bad thing, as networkmanager can use dhcpcd as a DHCP client, but dhcpcd5 can also be used as a standalone daemon.

So the solution is to remove *one* of them from the default runlevel.

I'm biased as I'm dhcpcd author  :Smile: 

----------

## benneque

Hi UberLord!

A man who knows what he says , fine!

As of networkmanager I can keep both USE Flags and networkmanager chooses one of them automatically.

The ultimate question still is:

Which of both should I use? Are there differences in performance? Everything else doesn't matter, cause usability is handled by networkmanager  :Wink: 

----------

## UberLord

 *benneque wrote:*   

> 
> 
> Which of both should I use? Are there differences in performance? Everything else doesn't matter, cause usability is handled by networkmanager 

 

dhcpcd uses a lot less memory than dhclient.

Networkmanager (last I looked) disabled ARP checking in dhcpcd so both should be of a similar speed.

dhcpcd supports CSR which dhclient does not, but to be fair not many servers only expose CSR options.

----------

