DNS issue ?

N

Nitro

Hi,
I have a windows2000 domain with DNS and DHCP on my servers

From a notebook I need to resolve an internal Host name in different ways
depending if notebook is connected to my windows domain or if notebook is
connected to internet using a dial-up modem connection (in the latter
situation notebook is disconnected from my domain also)

Is it possible to have the following situations 1 and 2 without changing
notebook configuration every time ?

1) Notebook connected to my win domain :

PING BINGO

Reply from 172.20.1.20
Reply from 172.20.1.20
......
...

2) Notebook disconnected from my win domain

PING BINGO

Reply from 62.110.138.50
Reply from 62.110.138.50
......



In situation 1, host name is resolved by internal DNS servers
In situation 2, internal DNS servers are not reachable so I tried using
HOSTS file , but after in situations 1 and 2 host BINGO is always resolved
to address specifed in HOSTS file.
In situation 1 I can resolve correctly host name if I use my domain
suffix :

PING BINGO.mydomain
Reply from 172.20.1.20
Reply from 172.20.1.20
......
...
But I need to ping BINGO and not BINGO.mydomain !


According to KB142309 name resolution order is :
1.. NetBIOS name cache
2.. WINS server
3.. B-node broadcast
4.. LMHOSTS file
5.. HOSTS file
6.. DNS server
To resolve host names I need to use DNS first, then HOSTS file and not the
contrary !

How can I sove this problem ?
How can I disable HOSTS file resolution when logged to my win domain ?

thanks in advance
Claude
 
W

William Stacey

If you need to use the host file, this may work, when disconnected, set the
local dns server to 127.0.0.1 using netsh in a batch file or other config
utils (there are a couple). Query will try 127 and not find a dns server
and try the host file - I think. I assume that when you say disconnected,
you mean walking around with laptop not connected to anything and want to
force a local IP for development or something. You could also use a local
dns server and point to that ( if your using w2k or w3k.) If xp or other,
you could get bind or tiny dns or something. The key is changing your dns
server list using netsh or other based on boot config.
 
N

Nitro

Thank you for your answer
My problem is to use my DNS server when connect to my win-domain , bypassing
hosts file configuration
If I configure HOSTS file, this file is always checked before my DNS
servers, so my BINGO host name is resolved always with public IP address

Nitro
 
W

William Stacey

Options:
1) Remove the hosts file. Not sure why you need it from the text.
2) Create a batch file that renames hosts to hosts.bak and runs ipconfig
/flushdns. Create an Icon for this batch, or run it manually.
3) Get one of those connection programs that allows you to change network
configs with a menu. Can't remember the name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top