Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-01-2011, 07:27 PM
|
#1
|
|
Member
Registered: May 2004
Posts: 204
Rep:
|
Forwarding DNS between two nics (separate networks)
I have a Deb 5 system with two nics... eth0 for internet (dhcp client) and eth1 for my private lan (static 172.16.0.1 gateway) and I have enabled tcp forwarding so my clients can reach the internet. However they have to type the ip address because DNS isnt working.
So now I want to set that up so DNS requests on the eth1 network can reach the internet through eth0. I am wondering how I might go about doing this. Should I install Bind9 and configure all that? Or is there a more simple way? Either way, it seems like I would still have to forward DNS requests or something.
I have never messed with DNS before so I am not sure where to go.
Thanks
Last edited by dave247; 10-02-2011 at 01:13 PM.
|
|
|
|
10-02-2011, 04:10 AM
|
#2
|
|
Member
Registered: May 2011
Distribution: Gentoo
Posts: 98
Rep:
|
Quote:
Originally Posted by dave247
... I have enabled tcp forwarding so my clients can reach the internet.
|
What is this "TCP forwarding" you're talking about? If the clients can reach Internet hosts by their actual IP address, that's IP forwarding (with NAT in your case); TCP forwarding is something else.
Quote:
Originally Posted by dave247
DNS isnt working
|
There are two ways to get DNS to work for the clients in the private network:
- Have the clients use the same DNS server as the router (your Linux system) does. This should work, unless you've done something that specifically prohibits UDP from being forwarded.
- Set up a DNS cache server on the router, and have the client use it as the DNS server. The simplest option here is dnsmasq. Note that dnsmasq can also be a DHCP server for your private network.
The advantage of setting up a DNS cache server is that the clients don't have to be configured the ISP's DNS server and reconfigured when it changes.
Last edited by ambrop7; 10-02-2011 at 04:14 AM.
|
|
|
|
10-02-2011, 06:45 AM
|
#3
|
|
Member
Registered: May 2004
Posts: 204
Original Poster
Rep:
|
Yeah I meant to say ip forwarding, not tcp, lol.
I already figured that the clients on my private network should use the same DNS server as my gateway but my confusion is how to do it. Do I put a line in the interfaces file? or in the hosts file?? what do I put and where do I put it?
Quote:
Originally Posted by ambrop7
What is this "TCP forwarding" you're talking about? If the clients can reach Internet hosts by their actual IP address, that's IP forwarding (with NAT in your case); TCP forwarding is something else.
There are two ways to get DNS to work for the clients in the private network:
- Have the clients use the same DNS server as the router (your Linux system) does. This should work, unless you've done something that specifically prohibits UDP from being forwarded.
- Set up a DNS cache server on the router, and have the client use it as the DNS server. The simplest option here is dnsmasq. Note that dnsmasq can also be a DHCP server for your private network.
The advantage of setting up a DNS cache server is that the clients don't have to be configured the ISP's DNS server and reconfigured when it changes.
|
|
|
|
|
10-02-2011, 07:16 AM
|
#4
|
|
Member
Registered: May 2011
Distribution: Gentoo
Posts: 98
Rep:
|
Quote:
Originally Posted by dave247
I already figured that the clients on my private network should use the same DNS server as my gateway but my confusion is how to do it. Do I put a line in the interfaces file? or in the hosts file?? what do I put and where do I put it?
|
That is some very basic configuration. Depends on what OS/distro the client uses. Lookup up the OS's documentation or Google it...
|
|
|
|
10-02-2011, 12:08 PM
|
#5
|
|
Member
Registered: May 2004
Posts: 204
Original Poster
Rep:
|
I have googled it. I have spent hours searching and reading but the solution is not clear. Every page I find is talking about something slightly different than applies to my situation.
Currently, ip traffic is forwarded from eth1 to eth0 but DNS requests are not. For example, from my client side of the network, I can go to 74.125.255.81 (google.com) but I can not go there by typing the name in the address bar. DNS is not configured properly or at all. I am trying to understand what I would do in this situation to get it working.
Quote:
Originally Posted by ambrop7
That is some very basic configuration. Depends on what OS/distro the client uses. Lookup up the OS's documentation or Google it...
|
|
|
|
|
10-02-2011, 12:23 PM
|
#6
|
|
Member
Registered: May 2011
Distribution: Gentoo
Posts: 98
Rep:
|
Quote:
Originally Posted by dave247
I have googled it. I have spent hours searching and reading but the solution is not clear. Every page I find is talking about something slightly different than applies to my situation.
|
On Linux, the DNS server addresses eventually go to /etc/resolv.conf:
Assuming you have IP itself working, manually editing /etc/resolv.conf should get DNS working too.
However, /etc/resolv.conf is usually automatically generated from other sources, and your edits will probably be lost soon. Instead, you should configure DNS servers appropriately via the network configuration system you're using. For example, if you're using Debian's /etc/network/interfaces commands, use the dns-nameservers option: (see Debian network setup documentation.)
Code:
allow-hotplug eth0
iface eth0 inet static
address 192.168.11.100
netmask 255.255.255.0
broadcast 192.168.11.255
gateway 192.168.11.1
dns-nameservers x.y.z.w
|
|
|
|
10-02-2011, 01:09 PM
|
#7
|
|
Member
Registered: May 2004
Posts: 204
Original Poster
Rep:
|
EDIT: It appears I got things working. Not sure what I did... but that's linux for you.
Last edited by dave247; 10-02-2011 at 01:13 PM.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:36 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|