# dhcp questions

## strubbldesign

is there a possibility to get ip+gateway+netmask via dhcp but use a static public ip for dnslookups?

----------

## Jaglover

 *strubbldesign wrote:*   

> is there a possibility to get ip+gateway+netmask via dhcp but use a static public ip for dnslookups?

 

You have chosen not to reveal what DHCP client you are using, thus the only suggestion is: read the man page for your client.

----------

## UberLord

Nearly all DHCP foo in Gentoo suports resolvconf, which will allow you to do what you want, so emerge openresolv  :Smile: 

----------

## strubbldesign

well...

i am using net-misc/Networkmanager

dhcpcd

the networkmanager allways overrides my /etc/resolv.conf

does openresolv does what i want?

thanks

cause settings in /etc/conf.d/net

doesent count

----------

## UberLord

Yes

----------

## strubbldesign

sorry wont work   :Crying or Very sad:  i forgot to mention that i use on xfce4 Knetworkmananger  :Very Happy: 

se my nslookup *Quote:*   

> 
> 
> daxbau dat # nslookup www.google.com
> 
> Server:         192.168.108.1
> ...

 

but my resolfconf.conf is: *Quote:*   

> daxbau dat # more /etc/resolvconf.conf 
> 
> # Configuration for resolvconf(
> 
> # See resolvconf.conf(5) for details
> ...

 

thanks for help

----------

## Jaglover

 *Quote:*   

> name_servers=208.67.222.222 

 

Looks like syntax error to me, then again, maybe not?   :Confused:  In any case, 

```
nameserver 1.2.3.4
```

 works for me.

----------

## strubbldesign

sorry but i removed the '='

wont work either...

 *Quote:*   

> name server 208.67.222.222

 

and still get *Quote:*   

> daxbau dat # /etc/init.d/NetworkManager restart
> 
>  * Stopping NetworkManager ...                                                                                                                                                                                                                                                   [ ok ]
> 
>  * Starting NetworkManager ...                                                                                                                                                                                                                                                   [ ok ]
> ...

 

----------

## Mike Hunt

Have you looked at the openresolv documentation? 

It works great and you can really do all kinds of things with it.  :Smile: 

----------

## UberLord

cat /etc/resolv.conf

The order of nameservers does matter ...

----------

## lemmingman

I use nm-connection-editor on my System -> preferences.  I use it to override all sorts of NetowrkManger stuff.  I think it is part of nm-applet.

----------

## strubbldesign

well isnt there an easier way for me just to use openDNS?

kind reguards

----------

## Mike Hunt

 *strubbldesign wrote:*   

> is there a possibility to get ip+gateway+netmask via dhcp but use a static public ip for dnslookups?

 

Simple (in fact UberLord answered it already): ip+gateway+netmask via dhcp 

dns via /etc/resolv.conf

```
nameserver x.x.x.x

nameserver x.x.x.x
```

 where x.x.x.x are the static public nameserver IPs of your ISP - could even be your router's IP.

----------

## strubbldesign

sorry but it dosen't work...

i wrote the ip of opendns to my /etc/resolv.conf

also removed the write premission of it

restarted networkmanager 

and get the same result (local dhcpserverIP)

----------

## strubbldesign

or could you give me

examples to the following configs with desciption...

 *Quote:*   

> 
> 
> /etc/dnsmasq-conf.conf
> 
> /etc/dnsmasq-resolv.conf
> ...

 

thank you

----------

## UberLord

 *strubbldesign wrote:*   

> or could you give me
> 
> examples to the following configs with desciption...
> 
>  *Quote:*   
> ...

 

Those files the example names that resolvconf generates for you to include in the local resolver config.

http://roy.marples.name/projects/openresolv/wiki/OpenResolvConfig

Here's another hint - you only need to enable one resolver, not all 3  :Wink: 

----------

## keenblade

 *strubbldesign wrote:*   

> sorry but i removed the '='
> 
> wont work either...
> 
>  *Quote:*   name server 208.67.222.222 
> ...

 

It still looks wrong; remove the space between "name" and "server" like this:

```

nameserver 208.67.222.222

```

----------

