Click here to Skip to main content
13,298,947 members (38,653 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 3 Jan 2012

Name resolving problem with DTC (Distributed Transaction Coordinator)

, 7 Jan 2012
Rate this:
Please Sign up or sign in to vote.
A solution for the name resolving problem with DTC.

If you have two servers (or more) in different networks and the DNS is not configured, does not exist, or is not used for any other case (like security or restrict access), you have a problem with the DTC when you try to INSERT, UPDATE, or DELETE data on a database server (or any other case).

The explanation for this is: imagine you have three layers of testing software environment of your software as in the example below:

Server 1 (Database server, for the example SQL SERVER)
ip address:
Server 2 (Application Server, IIS 7, 7,5)
ip address:

Client (your PC) both servers and your application are configured to use DTC.

If you try to execute the application hosted in server 2, the SELECT instructions work fine, but if you try to INSERT, DELETE, or UPDATE on the database, your application throws an unknown error related to a service, a method, or something in your applicattion. This error is provocated by DTC, because DTC uses a name resolving for communication with the other server if the operation tries to modify, add, or delete data.

In that case, you need to configure your DNS to quickly solve the problem. In case your network doesn't have a DNS server or the server (or both of them) doesn't have a DNS configured on the NIC's for any reason, you have a simple solution.

You need to modify two files in Windows (networks and hosts), on this path:


In the networks file, you have a structure like this:

# Copyright (c) 1993-1999 Microsoft Corp.
# This file contains network name/network number mappings for 
# local networks. Network numbers are recognized in dotted decimal form.
# Format:
# <network name="">  <network number="">     [aliases...]  [#<comment>]
# For example:
#    loopback     127
#    campus       284.122.107
#    london       284.122.108
loopback                 127

In DBSERVER, at the bottom of the file, you need to add a new network with the IP address of the other server, without the last octect of the IP address like this:

DBNETWORK 10.150.40

DBNETWORK is the name of the network (any other can work, you don't need to use the original network name to do this) and 10.150.40 is the range of this network.

Save and close the file, and then you need to edit the hosts file, this file has a structure like this:

# Copyright (c) 1993-2009 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
#          # source server
#              # x client host
# localhost name resolution is handled within DNS itself.
#       localhost
#	::1             localhost       localhost

In this file, you need to add the IP address and the name of the other server at the bottom of the file like this:  APPSERVER

You need to use the real name server in this case. Save and close the file, and next, do the same on the APPSERVER with the configuration of the DBSERVER. The network name on the other server, setup as APPNETWORK (or any other name).

Save these files on the other server and try to ping, and that's OK. Ping to the other server (with name server) is now working, with this, DTC can resolve locally the name of the other server without DNS.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Oscar Arros González
Software Developer (Senior) DirecTV S.A.
Chile Chile
Developer with experice in .NET 2005/2008/2010 (VB, C#)
SQL Server 2000/2005/2008.
Oracle 10g/11g
Java ADT (Eclipse)
I was working on software development the last 6 years, before that, i programming on different languages and work as System Administrator (System-V unix, Linux, Windows).

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171207.1 | Last Updated 7 Jan 2012
Article Copyright 2012 by Oscar Arros González
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid