Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-22-2005, 09:43 PM   #1
LQ Newbie
Registered: Jul 2003
Location: Durham, NC
Distribution: Fedora Core 2
Posts: 23

Rep: Reputation: 15
Configuring DNS and DHCP

Hi all,

I'm trying to configure a Fedora Core 2 PC to act as my home network's router for various windows and linux pcs. This PC has 2 NICs installed, and my network should look as follows:

Cable Modem ---eth0---> Fedora Core 2 ---eth1---> other Home Network PCs

from the Fedora box, I can access the internet properly, and my eth0 is configured via DHCP from the cable modem. I want to pass DNS requests from eth1 to eth0 and ultimately be able to host a DNS server on this machine.

Anyay, I set out to configure dhcpd for eth1 so that it will generate IP addresses for the other Home Network PCs. to do that, I kinda followed an app note and some other posts to do the following:

1) edit /etc/sysconfig/dhcpd and changed the line DHCPDARGS="" to DHCPDARGS="eth1"

2) create /etc/dhcpd.conf as follows (I got from the app note):
ddns-update-style ad-hoc;
allow bootp;
allow booting;
option timer-servers;
option domain-name "";
option domain-name-servers;
option broadcast-address;
option subnet-mask;
option routers;
subnet netmask

The idea here being that I want my eth1 NIC to have an address of, and all IP addresses assigned by it to the Home Network PCs would be from - 120.

3) I edited /etc/named.conf to include a new "zone" per the app note:
zone ""
type master;
file "var/named/";

4) created file /var/named/ as follows (again from the app note):
$ttl 38400 IN SOA
1031361928; se = serial number
10800; ref = refresh
3600; ret = update retry
604800; ex = expiration
38400; min = minimum

5) edited /etc/hosts to include the following (left default lines there): firewall firewall

6) I then started the dhcpd and named services.

I connected my laptop to eth1, and it obtains an IP address of, but I cannot connect to the internet. It cannot find the DNS server. The gateway is set to and when I run nslookup <anything> it tells me it cannot find the DNS server

I think the problem is a mistake I have made somewhere trying to get eth1 to pass DNS requests to eth0 and hence to the ISP's DNS servers. I really need some help determining where to go next.
Old 03-22-2005, 11:57 PM   #2
Registered: Aug 2003
Location: Denver, CO
Distribution: CentOS, Debian
Posts: 825

Rep: Reputation: 33
i don't know a lot about this stuff, but a couple things:

1. are you running a firewall? i know named listens on port 53 by default, so is this open?
2. i believe you need to set up ip masquerading, so that packets relayed from eth1 to the outside world appear to originate from eth0.

i've never set up masquerading, but look around and there's a lot of info i believe. but i don't really know what i'm talking about, so take it with a grain of salt. another thought is you could monitor traffic with tcpdump while you try connecting to a website with your client machine, and see if any obvious errors jump out at you.

tcpdump -i eth1 -n

for instance...
Old 03-24-2005, 07:48 AM   #3
LQ Newbie
Registered: Jul 2003
Location: Durham, NC
Distribution: Fedora Core 2
Posts: 23

Original Poster
Rep: Reputation: 15

You were right. I didn't realize it was called ip masquerading or else my google searches would've been more effective. I did a little more searching and it turns out there was an article on,, that helped configure iptables to do this, even though his setup was a little different.

Thanks so much for your help.
Old 03-24-2005, 06:21 PM   #4
Registered: Aug 2003
Location: Denver, CO
Distribution: CentOS, Debian
Posts: 825

Rep: Reputation: 33

btw, i tried that link out (for someone else with a similar question) and it doesn't work. i googled ip masquerading and found this one though, if you want/need more resources:

Last edited by mcd; 03-24-2005 at 06:25 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
configuring dhcp eddie700 Fedora 2 10-09-2005 12:49 PM
configuring dns server on dhcp client ydpk Linux - Networking 3 11-04-2004 11:23 PM
forward dns from dhcp to dhcp Fark Linux - Networking 3 03-31-2004 11:40 AM
configuring ip address without using dhcp sanjaymistry Linux - Networking 3 09-02-2003 04:06 AM
DHCP and DNS and configuring both... wlewis Linux - Networking 2 07-20-2002 03:03 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration