# [SOLVED] DNS information

## Steve Cave

Hello. How can I use dhcpcd just to update /etc/resolv.conf with DNS information from a DHCP server (and not obtain an IP address lease)? Thanks in advance.Last edited by Steve Cave on Tue Mar 10, 2009 5:33 am; edited 1 time in total

----------

## Steve Cave

Does anybody have any suggestion as to what I should do to get the DNS servers from my router without requesting an IP? I currently use a static /etc/resolv.conf, and our ISP's nameservers change from time to time.

----------

## magic919

Have a look at DHCP and break it down so you know which option number you want.  Then take a look at the DHCP client and see if you can implicitly request/exclude options.

----------

## cyrillic

Another option would be to fix the DHCP server's configuration so it gives you the IP address you want.  That way you wouldn't need to finagle a static IP + dynamic DNS solution.

----------

## Steve Cave

Thank you both for your answers. I'll take a look at my DHCP client's options, as per Magic's suggestion, but I suspect Cyrillic's idea to be the more commonly employed solution for this type of problem.

----------

## UberLord

 *Steve Cave wrote:*   

> Hello. How can I use dhcpcd just to update /etc/resolv.conf with DNS information from a DHCP server (and not obtain an IP address lease)? Thanks in advance.

 

You need to use DHCP INFORM.

dhcpcd -s 192.168.0.1

or

dhcpcd --inform

and dhcpcd will work out the address for you.

You can either configure this in /etc/conf.d/net like so

dhcpcd_eth0="--inform"

or in /etc/dhcpcd.conf like so

```
interface eth0

inform
```

However, not all DHCP servers support DHCP INFORM so in this case you'll have to take the advice above and hard code the ip address to the mac address in the dhcp server.

----------

## Steve Cave

Ok, thanks!

----------

