LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-25-2006, 01:44 AM   #1
JustMoi
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Rep: Reputation: 0
Dns Server Inside A Lan


[HTML]
<body>
<pre>

*********
** INTERNET **
** **
********* \
\
\ _____
|_____| DSL MODEM
\
\
switch \ __
_______ | | Server (static IP from DSL)
|0 0 0 0|-------| | (Gateway)
/ _______ |__| 192.168.0.1
/ \
__/ \__
| | | |
| | | |
|__| |__|
PC1 PC2
(DNS Server)
192.168.0.2 192.168.0.3

</pre>


How can I make PC2 a DNS Server available to the Internet?


Thanks.
</body>
[/HTML]
 
Old 10-25-2006, 04:17 AM   #2
hhvv
Member
 
Registered: May 2006
Location: India
Distribution: RHEL,CentOS,BSD,Ubuntu
Posts: 59
Blog Entries: 1

Rep: Reputation: 15
iptables

I prefer iptables
Use port forwarding and NATing
 
Old 10-25-2006, 09:03 PM   #3
JustMoi
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks...

but port forwarding in PC2 or in the server?
 
Old 10-25-2006, 10:53 PM   #4
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
You want to use port forwarding on the server to send all inbound DNS traffic to PC2.
 
Old 10-26-2006, 12:46 AM   #5
JustMoi
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Ok thanks a lot...

Will try to figure out how to do that.

thanks centauricw & hhvv
 
Old 10-26-2006, 01:00 AM   #6
tola555
LQ Newbie
 
Registered: Sep 2005
Posts: 20

Rep: Reputation: 0
what you need is prerouting rule in iptables.

Code:
EXT_IF=eth0
SERVER_IP='192.168.0.1'

iptables -t nat -A PREROUTING -i $EXT_IF -p UDP -d $SERVER_IP --dport 53 -j DNAT --to-destination $PC2_IP

--dport as --destination-port
-d is destination ip in packet header
take a look into http://iptables-tutorial.frozentux.n...-tutorial.html
there is examples at the end and all knowledge you need to do your firewall

Last edited by tola555; 10-26-2006 at 07:17 AM.
 
  


Reply


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
DNAT to web server inside LAN? sarajevo Linux - Security 1 06-05-2006 06:57 AM
iptables inside client to inside host with outside DNS or IP - Help! linuxhelp2 Linux - Networking 1 10-15-2005 06:19 AM
Server from inside LAN andrewjjones Linux - Networking 53 04-22-2005 02:07 PM
Apache 2 Server - Can't access it via ip address from inside LAN Robstro Linux - Networking 1 06-30-2004 01:50 PM
DNS/email issues inside and out of LAN swingheim Linux - Networking 4 11-22-2003 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:05 AM.

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