openSUSE Forums > Network/Internet » How to setup DNS servers on host, connected to 2 networks?

Go Back   openSUSE Forums > Network/Internet
Forums FAQ Members List Search Today's Posts Mark Forums Read

Network/Internet Questions about internet applications, network configuration, usage (SAMBA, network printing, NFS)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-Jul-2009, 09:20
Puzzled Penguin
 
Join Date: Jul 2009
Posts: 2
SuseSearcher hasn't been rated much yet
Default How to setup DNS servers on host, connected to 2 networks?

Please, excuse me for my terrible English.

My host has two NICs, first in a network, connected to Internet through gateway, and the second one in a local network, with its own DNS server.
When i try to resolve a name to ip, a query have been send to DNS server, which stay on first position in /etc/resolv.conf, and, if server don't know this name, the answer is "unknown host". So, if i set my gateway on the first position in /etc/resolv.conf, i can resolve names from internet, and can't resolve names from local network.

Of course, i can setup on my host a DNS server, which will send queries to local server the same way as to gateway. But i'm looking for a most simple way.

Can somebody prompt me a way, how can i set up my SLES for query both DNS servers - gateway and local DNS server.

My settings:
Code:
eth0 - local network (195.0.0.0 mask 255.255.0.0)
eth1 - network with gateway (192.168.0.0 mask 255.255.255.0 gateway 192.168.0.1)

ifconfig -a:

eth0 Link encap:Ethernet HWaddr 00:1D:60:48:B5:7D
inet addr:195.0.4.70 Bcast:195.0.255.255 Mask:255.255.0.0
inet6 addr: fe80::21d:60ff:fe48:b57d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7338 errors:0 dropped:0 overruns:0 frame:0
TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:663630 (648.0 Kb) TX bytes:6444 (6.2 Kb)
Interrupt:217

eth1 Link encap:Ethernet HWaddr 00:04:76:13:8F:1A
inet addr:192.168.0.56 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::204:76ff:fe13:8f1a/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:33025 errors:0 dropped:0 overruns:1 frame:0
TX packets:4737 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7125584 (6.7 Mb) TX bytes:703638 (687.1 Kb)
Interrupt:225 Base address:0xc00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:10758 errors:0 dropped:0 overruns:0 frame:0
TX packets:10758 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2013080 (1.9 Mb) TX bytes:2013080 (1.9 Mb)

sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

/etc/resolv.conf
search kbsapr.ru
nameserver 192.168.0.1
nameserver 195.0.0.7
#kbsapr.ru - windows-domen in local network

eth0
/etc/sysconfig/network/ifcfg-eth-id-00:1d:60:48:b5:7d
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='195.0.4.70'
MTU=''
NAME='ASUSTeK Marvell 88E8001 Gigabit Ethernet Controller (Asus)'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
UNIQUE='rBUF.FjMv6GbsXF7'
USERCONTROL='yes'
_nm_name='bus-pci-0000:04:04.0'
IFPLUGD_PRIORITY='20'
PREFIXLEN=''
NETMASK='255.255.0.0'


eth1
/etc/sysconfig/network/ifcfg-eth-id-00:04:76:13:8f:1a
BOOTPROTO='dhcp'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME='3Com 3C905CX-TX/TX-M Fast Etherlink for PC Management NIC'
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
UNIQUE='JNkJ.wQq3lwZp4Y5'
USERCONTROL='no'
_nm_name='bus-pci-0000:04:00.0'
Reply With Quote
  #2 (permalink)  
Old 07-Jul-2009, 12:23
hcvv's Avatar
Wise Penguin
 
Join Date: Jun 2008
Location: Netherlands
Posts: 1,791
hcvv is on a distinguished reputation roadhcvv is on a distinguished reputation road
Default Re: How to setup DNS servers on host, connected to 2 network

I know one thing for sure: this can not be resolved by doing something to resolv.conf. In resolv.conf the second (and further) servers are only mentioned for the case the first does not answer. All servers mentioned there are supposed to give the same information.

IMHO you can not have two seperate DNS worlds on one system. Normally you use your local DNS server (which has the zone files for your subdomains) and it points to the ouside DNS server(s) for all other information. So when you ask for forums.opensuse.org, you go to your local DNS server, which will forward this question to the DNS server of your ISP (or another one on the Internet).
__________________
Henk van Velden
Reply With Quote
  #3 (permalink)  
Old 07-Jul-2009, 12:45
cjcox's Avatar
Parent Penguin
 
Join Date: Jun 2008
Location: Frisco, TX
Posts: 761
cjcox hasn't been rated much yet
Default Re: How to setup DNS servers on host, connected to 2 networks?

On Tue, 2009-07-07 at 14:26 +0000, SuseSearcher wrote:
> Please, excuse me for my terrible English.
>
> My host has two NICs, first in a network, connected to Internet through
> gateway, and the second one in a local network, with its own DNS
> server.
> When i try to resolve a name to ip, a query have been send to DNS
> server, which stay on first position in /etc/resolv.conf, and, if server
> don't know this name, the answer is "unknown host". So, if i set my
> gateway on the first position in /etc/resolv.conf, i can resolve names
> from internet, and can't resolve names from local network.


So, you're local DNS is just local entries (presumably non-recursive not
handling entries outside of zones defined there).

You could setup your own DNS server (as you said). It's not hard.
Just setup a zone that forwards out your local DNS zone/server. The
rest will be handled as a simple caching DNS.

That should do it.


>
> Of course, i can setup on my host a DNS server, which will send queries
> to local server the same way as to gateway. But i'm looking for a most
> simple way.


That IS the simple way.. and it really is simple.

>
> Can somebody prompt me a way, how can i set up my SLES for query both
> DNS servers - gateway and local DNS server.


Reply With Quote
  #4 (permalink)  
Old 07-Jul-2009, 12:51
Camaleón
Guest
 
Posts: n/a
Default Re: How to setup DNS servers on host, connected to 2 networks?

SuseSearcher wrote:

> My host has two NICs, first in a network, connected to Internet through
> gateway, and the second one in a local network, with its own DNS
> server.
> When i try to resolve a name to ip, a query have been send to DNS
> server, which stay on first position in /etc/resolv.conf, and, if server
> don't know this name, the answer is "unknown host". So, if i set my
> gateway on the first position in /etc/resolv.conf, i can resolve names
> from internet, and can't resolve names from local network.
>
> Of course, i can setup on my host a DNS server, which will send queries
> to local server the same way as to gateway. But i'm looking for a most
> simple way.
>
> Can somebody prompt me a way, how can i set up my SLES for query both
> DNS servers - gateway and local DNS server.


How about using "/etc/hosts" file?

You can define there a list of local ip/machine names, not suitable for dns
querying but at least useful for lan browsing.

Greetings,

--
Camaleón
Reply With Quote
  #5 (permalink)  
Old 07-Jul-2009, 13:18
Puzzled Penguin
 
Join Date: Jul 2009
Posts: 2
SuseSearcher hasn't been rated much yet
Default Re: How to setup DNS servers on host, connected to 2 network

Thanks 2 all. I just wanted to be sure, that there are no other ways to solve this problem.
BIND waits for me

p.s. Local network is too large for describing in /etc/hosts
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2