# /etc/conf.d/net configuration question

## redwood

Hi,

I'm running x86 Gentoo Linux-2.6.20-gentoo-r5 

with sys-apps/baselayout-1.12.9

I have a small network consisting of 

1) 192.168.1.1           DSL/modem/router/firewall

2) 192.168.1.254      dhcp/dnsmasq server running net-misc/dhcp-3.0.5-r1 and net-dns/dnsmasq-2.38-r1

3) dhcpd client

The /etc/conf.d/net file for my dhcpd client is as follows:

config_eth0=( "dhcp" )

dns_domain_lo="mydomain.net"

routes_eth0=( "default via 192.168.1.1" )

dns_domain_eth0="mydomain.net"

# dnsmasq server + dns servers provided by Verizon

dns_servers_eth0="192.168.1.254 71.252.0.12 68.238.112.12"

But my /etc/resolv.conf file is:

# cat /etc/resolv.conf

# Generated by dhcpcd for interface eth0

search mydomain.net

nameserver 192.168.1.1

So my lookups are slow.

I want my  /etc/resolv.conf to include the

dns servers provided by Verizon, similar to the following:

search mydomain.net

#nameserver 192.168.1.1

nameserver 192.168.1.254          #my dnsmasq server

nameserver 71.252.0.12               #verizon dns1

nameserver 68.238.112.12          #Verizone dns2

Does anyone know the proper way to configure /etc/conf.d/net

for my simple example?

Or is the problem with my dhcp/dnsmasq server?

----------

## gentoome

Hi,

I must admit I do not understand your point :

You have two program running, one that offers caching services for dns requests and the other a dhcp server. However, you complain that caching is too slow and want your client machines to be able to query directly the dns servers that are actually cached by dnsmasq. Moreover, the configuration you're suggesting at the end of your post would not be any faster, unless you use "option round", since resolv.conf is queried in descending order, which means that dnsmasq would have to timeout before your client's resolver would try and query Verizon's servers. If using Verizon's server is always faster than using caching, why use caching ? 

On the dhcp side, according to your /etc/init.d/net you seem to only be using the address attribution a capability, since you specify everything else. Why not go static ?

Second, dnsmasq has dchp server capability. I suggest you use it (I started out just like you with dnsmasq + dhcpd, but why have two daemons loaded whan one can do the trick ?)

Lastly, if you really do want to maintain such a set-up I would suggest editing the resolv.conf on the client machine manually and then passing -R to dhcpcd in the /etc/init.d/net to prevent it from overwriting resolv.conf.

Cheers,

John

----------

## redwood

Sorry for being too obtuse.

My dhcp/dnsmasq server (192.168.1.254) is running dhcpd because it is also serving LTSP kernels via tftp.

It's also running an asterisk+freepbx(mysql+apache2) server. Another computer is acting as the xdmcp/application

server. I also have network printers and scanners, and various other dedicated servers, as well as laptops.

I'm running dnsmasq only for  my privately assigned  IP #'s so that they are visible on the local net, and everyone can login to their voicemail/email etc. I am not running a full caching dns, 

I want names like laptop1.mydomain.net or voicemail.mydomain.net or pbx.mydomain.net

 to be resolved by my local dnsmasq server 192.168.1.254.

Names like www.google.com I want resolved using Verizon's name servers.

I have a Linksys WRT54G wireless router access point (192.168.1.1) 

bridged to a Verizon DSL/modem/router (192.168.1.1)

At one time I had my Linksys router also acting as a dhcp server. 

After I setup LTSP thinclients I moved the dhcpd server to my tftp server (192.168.1.254). 

However, the Linksys router is still my default gateway 

(it's the only computer on my network with both an external IP and an internal IP)

But the new baselayout configuration which uses a single /etc/conf.d/net file results in 192.168.1.1 being not only my

default gateway but my nameserver as well (and I don't know why since I explicitly setup 3 nameservers for eth0):

#cat /etc/conf.d/net

config_eth0=( "dhcp" )

dns_domain_lo="mydomain.net"

routes_eth0=( "default via 192.168.1.1" )

dns_domain_eth0="mydomain.net"

dns_servers_eth0="192.168.1.254 71.252.0.12 68.238.112.12"

Why does the above setup result in 

# cat /etc/resolv.conf

# Generated by dhcpcd for interface eth0

search mydomain.net

nameserver 192.168.1.1

Why doesn't dns_servers_eth0="192.168.1.254..." result in

nameserver 192.168.1.254 ?

My Linksys router knows absolutely nothing about the IPs assigned by my dhcpd/dnsmasq server (192.168.1.254), 

although it does know about Verizon's nameservers (from the DSL modem to which it's bridged):

(From the status page of my Linksys router:)

Login Type:  	PPPoE  	   	 

Login Status:	Connected  	 	 

IP Address: 	xxx.xxx.xxx.xxx	  	 

Subnet Mask: 	255.255.255.255 	  	

Default Gateway: 	10.13.7.1 	  	

DNS 1: 	71.252.0.12 	  	 

DNS 2: 	68.238.112.12

My dhcpd/dnsmasq server is setup to use Verizon's nameservers for names it can't resolve.

I hope this explanation is clearer.

Thanks for answering my post.

----------

## think4urs11

add the below to /etc/conf.d/net - should do the trick

```
dhcp_eth0="nodns"
```

as written in /etc/conf.d/net.example

----------

## redwood

Thanks. I knew I was misunderstanding something in this new baselayout configuration.

----------

