LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Dns Server Inside A Lan (https://www.linuxquestions.org/questions/linux-networking-3/dns-server-inside-a-lan-495338/)

JustMoi 10-25-2006 01:44 AM

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]

hhvv 10-25-2006 04:17 AM

iptables
 
I prefer iptables
Use port forwarding and NATing

JustMoi 10-25-2006 09:03 PM

Thanks...

but port forwarding in PC2 or in the server?

centauricw 10-25-2006 10:53 PM

You want to use port forwarding on the server to send all inbound DNS traffic to PC2.

JustMoi 10-26-2006 12:46 AM

Ok thanks a lot...

Will try to figure out how to do that.

thanks centauricw & hhvv :)

tola555 10-26-2006 01:00 AM

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


All times are GMT -5. The time now is 08:46 PM.