1832853 Members
3011 Online
110047 Solutions
New Discussion

Re: name resolution

 
Stefano_1
Frequent Advisor

name resolution

I have a server with two interface:
lan0=192.168.4.1
lan1=172.16.4.1
the two interface doesn't communicate between them(they are separated).
The hostname of the server is SERVER1 for both interface(Is it possible?).
Since I have only one domain(mydomain.com), but two different DNS server,one for the network of lan0 and one for the network of lan1, how can I configure my server(the /etc/hosts , /etc/resolv.conf and /etc/nisswitch.conf files)?
thanks in advance for every help
7 REPLIES 7
Tim D Fulford
Honored Contributor

Re: name resolution

Stefano

If you only have one domain you do not need to worry! It should not matter on which interface the resolution comes from. (I assumung you have two DNS servers one on 172 & one on 192).

You have a choice of 3 things
* Name resolves to 172 address, local routing
* Name resolves to 192 address, local routing
* Name neither 172 or 192. This will depend on your routing table but you probably have one or more default routers & they should come into play. If not then there IS no route to the host (that your m/c knows of).

The routing configuration is viewed with
# netstat -r[n]
(routing info).

I think this answers you question.

Tim
-
Mark van Hassel
Respected Contributor

Re: name resolution

Stefano,

It is not advisible to use the same alias for multiple IP addresses. When using the same aliases it is hard to keep control over the network communication and routing.
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
Marcin Wicinski
Trusted Contributor

Re: name resolution

Hi Stefano,

As far as I know it is not good to asign the same name to two differnt network interfaces, thus I suggest to assign different names.

Name resolution based on dns for two nets you can configure in /rtc/resolv.conf - just put two lines: first for nameserver of the first net and second line for the nameserver of the second net. When dns won't be able to resolve the name through the first nameserver it will ask the second namserver.


later,
Marcin Wicinski
Tim D Fulford
Honored Contributor

Re: name resolution

Oops

/etc/resolv.conf
domain mydomain.com
server 172.16.?.?
server 192.168.4.?
* the order here is up to you.

/etc/nsswitch.conf
hosts dns [NOTFOUND=CONTINUE] files
* The order here is up to you

/etc/hosts
192.168.4.1 server1 server1.mydomain.com server1-192
172.16.4.1 server1 server1.mydomain.com server1-172
* The order her is up to you. I personally NOT have two addresses with the same name (but you can). So here I would also give aliases for each interface.

** BEWARE **
if you do have two addresses with the same host name, DNS will 'round robin them. So If there is not route from 192 to 172 any server resolving the "myserver hostname" will alternately get 172.16.4.1 & 192.168.4.1 hence it will work intermittently!!

Tim
-
Stefano_1
Frequent Advisor

Re: name resolution

Thanks Tim,
in fact I have a default getaway for each interface.
I can't use a alias for the second interface, so I think I will have some problem with the resolution of the name.
What do you think?
Tim D Fulford
Honored Contributor

Re: name resolution

If you can't put an alias in DNS then never mind. I still would do it in the /etc/hosts file though for [local] clarity.

Tim
-
rick jones
Honored Contributor

Re: name resolution

multiple default gateways will probably not work they way you might expect unless you are on HP-UX 11 and have set ip_strong_es_model to a value of 1. otherwise, only one tends to get used.

there is no rest for the wicked yet the virtuous have no pillows