Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/conf.d/net configuration question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
redwood
Apprentice
Apprentice


Joined: 27 Jan 2006
Posts: 234

PostPosted: Wed Apr 11, 2007 5:08 pm    Post subject: /etc/conf.d/net configuration question Reply with quote

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?
Back to top
View user's profile Send private message
gentoome
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jul 2005
Posts: 78

PostPosted: Thu Apr 12, 2007 10:42 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
redwood
Apprentice
Apprentice


Joined: 27 Jan 2006
Posts: 234

PostPosted: Thu Apr 12, 2007 9:52 pm    Post subject: Some clarification Reply with quote

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.
Back to top
View user's profile Send private message
think4urs11
Administrator
Administrator


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Thu Apr 12, 2007 10:56 pm    Post subject: Reply with quote

add the below to /etc/conf.d/net - should do the trick
Code:
dhcp_eth0="nodns"

as written in /etc/conf.d/net.example
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
redwood
Apprentice
Apprentice


Joined: 27 Jan 2006
Posts: 234

PostPosted: Fri Apr 13, 2007 12:02 am    Post subject: Thanks Reply with quote

Thanks. I knew I was misunderstanding something in this new baselayout configuration.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum