Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

DHCP and resolv.conf

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> DHCP and resolv.conf Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
DHCP and resolv.conf - Apr. 7, '05, 7:30:09 AM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
This draws together two other threads plus some e-mail.
The threads are:
http://www.interopsystems.com/tools/forum/tm.aspx?m=4770&mpage=2&key=dhcpᏎ and
http://www.interopsystems.com/tools/forum/tm.aspx?m=4665&mpage=1&key=dhcpᏒ

It centers around the problem of the /etc/resolv.conf file not always getting
filled in correctly. This can happen at installation because the script that does
the work is for English only. When DHCP or dialup is being used no information may
go into the /etc/resolv.conf file, or it may become invalid. This messes up
programs using the BIND library. /Tools Forum members breiter wrote a script
that can regularly run and refresh the configuration file.

breiter's script can be found, as a package, in:
 ftp://ftp.interopsystems.com/pkgs/beta/dhclient-1.0.1-bin.tgz


But as member cortez pointed out, the language differences aren't handled.
So the script needs to be locally tuned. That's not too hard to do, but not
everyone is comfortable (or savvy) doing this.

Because I was looking to avoid doing something else I've just changed how BIND
works with Interix to call an ioctl() when a nameserver and/or domain cannot be
found in /etc/resolv.conf. The ioctl()'s are extensions to those that
ship with SFU/Interix and are part of libport but I've wedged it into
libbind. I tested it to see how well it works with ftp on an
English Windows and it's fine. I'm pretty sure that the solution is language
neutral, so I need to have volunteers with non-English Windows try it out by
removing the content of their /etc/resolv.conf and then try ftp'ing
somewhere. If it works, then I'll post new versions of libbind and anything
here at /Tools that links with it.

Are there any volunteers ?

< Message edited by Rodney -- Apr. 7, '05, 4:08:52 PM >
Post #: 1
RE: DHCP and resolv.conf - Apr. 7, '05, 4:11:38 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
I'll add that it's up as a beta package now:
    pkg_add ftp://ftp.interopsystems.com/pkgs/beta/ftp-3.4d-bin.tgz

(in reply to Rodney)
Post #: 2
RE: DHCP and resolv.conf - Apr. 9, '05, 11:17:57 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
I'll have a check on this on my machines on Monday.

BTW - was not the OpenSSH which was also linked with bind and was the source where the problem was found?

Is the OpenSSH packahe statcially or synamically linked to the Bind libs?

< Message edited by cortez_ -- Apr. 9, '05, 11:28:33 AM >

(in reply to Rodney)
Post #: 3
RE: DHCP and resolv.conf - Apr. 9, '05, 7:31:43 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Everything with BIND is currently a static link because I didn't
build a shared library. So openssh is a static link with BIND.
Openssh is dynamically linked with openssl so that openssl
updates can be made independently.

> BTW - was not the OpenSSH which was also linked with bind and was the source where the problem was found?

The situation of the resolv.conf file not getting filled correctly became the
apparent cause of openssh not resolving hostnames in a set of particular situations.
One of these was being experienced by you. So it wasn't, by the design
of things, an openssh or bind problem. It was a problem with the script
that fills in the resolv.conf file at SFU installation being an English-only
script. So this indicates a design problem. The solution needs to be something more portable
(more language neutral). So having an adjustment in the libbind code at process
initialization seemed right. But I needed to think about this for a while and look at a
lot of code and hunt down information. And shoving a large amount of non-portable code into
libbind is not a good idea (particularly when it's time to update it, which is also RSN).
And there may be other applications which could benefit from getting this information in
the future. So a little bit of code has been added to libbind to make an ioctl()
call to get the information.

I did end up releasing bind with the change because of the security alert about
the poisoned DNS caches with Windows DNS. A good, working alternative to Windows DNS is
needed to be used more often

< Message edited by Rodney -- Apr. 9, '05, 7:40:51 PM >

(in reply to cortez_)
Post #: 4
RE: DHCP and resolv.conf - Apr. 11, '05, 2:14:56 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
So just to be sure, if the openssh is statically linked with Bind - will this change in bind influence it's behaviour? Or will an update of openssh be neccesary?

(in reply to Rodney)
Post #: 5
RE: DHCP and resolv.conf - Apr. 11, '05, 3:03:57 AM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Openssh 4.0p1 has already been updated to use the new bind.
This was in the Forum Announcements section a couple of days ago.
See: http://www.interopsystems.com/tools/forum/tm.aspx?m=5244

(in reply to cortez_)
Post #: 6
RE: DHCP and resolv.conf - Apr. 11, '05, 9:01:25 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
I have updated the openssh package, and after removing form /etc/resolv.conf all the nameserver and other content, the behavoiur is still the same - the error: Temporary failure remains. Shall I reboot the system after updating the openssh package? I want to use only the client?

(in reply to Rodney)
Post #: 7
RE: DHCP and resolv.conf - Apr. 11, '05, 11:30:38 AM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
What was the exact command you issued ? (quote it please).

There might be a problem with the 'search' part as I try things here now.
So if the name is fully qualified (foo.bar.com) it's fine, but a shortname isn't (foo)
all the time (edge condition). I'll look at this.

(in reply to cortez_)
Post #: 8
RE: DHCP and resolv.conf - Apr. 11, '05, 3:23:12 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Okay, I made the fix for the 'search' working correctly. I'd confused it with 'domain'.
I also extended out to find multiple NIC's.
So there's a new package (with a new micro number) that you can try:
pkg_add ftp://ftp.interopsystems.com/pkgs/beta/openssh-current-bin.tgz

Thanks for giving it a test.

(in reply to Rodney)
Post #: 9
RE: DHCP and resolv.conf - Apr. 12, '05, 2:43:45 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
That's weird - either I'm doing something wrong or...
Cpuld you give me a hint, I've updated the openssh to the new version. Removed all the data from /etc/resolv.conf so that it looks like this:

# This file was automatically generated on  Tue Feb 22 17:41:53 CET 2005
#
nameserver
lookup file bind



Then I invoke the ssh client with the following command:
quote:


gprzybylski /interix_utils/beta#>which ssh
/usr/local/bin/ssh
gprzybylski /interix_utils/beta#>ssh wierzba.miks.uj.edu.pl
ssh: wierzba.miks.uj.edu.pl: temporary failure
gprzybylski /interix_utils/beta#>

When I update the nameserver in /etc.resolv.conf it works fine:
see below:
quote:


gprzybylski /interix_utils/beta#>cat /etc/resolv.conf
# This file was automatically generated on Tue Feb 22 17:41:53 CET 2005
#
nameserver 10.10.1.5
lookup file bind
gprzybylski /interix_utils/beta#>ssh wierzba.miks.uj.edu.pl
's password:

gprzybylski /interix_utils/beta#>

So it resolvs the url

See again the two situations. First with no nameserver entered, see that nslookup fails, ping resolvs the hostname so that it means that the remote host is up and running, and after entering the nameserver in /etc/resolv.conf it works fine
quote:



gprzybylski /interix_utils/beta#>cat /etc/resolv.conf
# This file was automatically generated on Tue Feb 22 17:41:53 CET 2005
#
nameserver
lookup file bind
gprzybylski /interix_utils/beta#>nslookup wierzba.miks.uj.edu.pl
Server: pcbprzybylski
Address: 0.0.0.0

*** pcbprzybylski can't find wierzba.miks.uj.edu.pl: No response from server
gprzybylski /interix_utils/beta#>ping wierzba.miks.uj.edu.pl
PING wierzba.wzks.uj.edu.pl (149.156.161.18): 56 data bytes
64 bytes from 149.156.161.18: icmp_seq=0 ttl=55 time=15.625 ms
64 bytes from 149.156.161.18: icmp_seq=1 ttl=55 time=15.625 ms
64 bytes from 149.156.161.18: icmp_seq=2 ttl=55 time=15.625 ms
^C
--- wierzba.wzks.uj.edu.pl ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 15.625/15.625/15.625 ms
gprzybylski /interix_utils/beta#>pkg_info | grep bind
bind-9.2.3.3-bin Version 9.2.3.3 of bind for Interix 3.5.
gprzybylski /interix_utils/beta#>pkg_info | grep openssh
openssh-4.0.0.1.2-bin Version 4.0.0.1.2 of openssh for Interix 3.5.
gprzybylski /interix_utils/beta#>cat /etc/resolv.conf
# This file was automatically generated on Tue Feb 22 17:41:53 CET 2005
#
nameserver 10.10.1.5
lookup file bind
gprzybylski /interix_utils/beta#>nslookup wierzba.miks.uj.edu.pl
Server: moria.teatralne.comarch
Address: 10.10.1.5

Non-authoritative answer:
Name: wierzba.wzks.uj.edu.pl
Address: 149.156.161.18
Aliases: wierzba.miks.uj.edu.pl

gprzybylski /interix_utils/beta#>ssh wierzba.miks.uj.edu.pl
's password:

gprzybylski /interix_utils/beta#>

(in reply to Rodney)
Post #: 10
RE: DHCP and resolv.conf - Apr. 12, '05, 3:16:09 AM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The only thing I can think of offhand is that my solution isn't portable to
all language versions of Windows. Which is annoying.
You have the right version of openssh and everything.
Damn, I'll have to ponder this some more then.

Thanks again for doing the test.

(in reply to cortez_)
Post #: 11
RE: DHCP and resolv.conf - Apr. 12, '05, 4:22:24 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
Maybe you could make some test version that would expose some more information verbosely while resolving the address, or maybe you could post the part of the source code so that I could check how it behaves on my system?

I still have the impression that I'm doing something wrong.

(in reply to Rodney)
Post #: 12
RE: DHCP and resolv.conf - Apr. 12, '05, 1:34:30 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> I still have the impression that I'm doing something wrong.

No, your were doing it right (to the resolv.conf).

I will write up a separate, small test program later to send to you.

(in reply to cortez_)
Post #: 13
RE: DHCP and resolv.conf - Apr. 12, '05, 3:08:49 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
I have placed a small test program (60k) on the ftp site: ftp://ftp.interopsystems.com/pub/testioctl
It will either give results or errno output.

You may also want to try running Mark's program mkresolv-conf.exe which is at the same location to
see if it is able to do something.

(in reply to Rodney)
Post #: 14
RE: DHCP and resolv.conf - Apr. 12, '05, 3:57:39 PM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
I made the test with testioctl on a Windows XP PL (Polish) SP1 - it is ont the same machine as in the morning but i think the results show that it doesn't receive this information, see below, tommorow (in about 10 hours) I'll test in at work on another machine:

root ~/interix_utils/build#>./testioctl
SIOCGIFNS: No such file or directory
search==""
domain==""
root ~/interix_utils/build#>

(in reply to Rodney)
Post #: 15
RE: DHCP and resolv.conf - Apr. 12, '05, 4:33:46 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Okay, it's as I suspected. It works on English and "multilanguage" versions of Windows
but not on "localized" versions of Windows. The multilanguage versions have all of the config
file and registry keys the same as English but display all GUI stuff per the locale. The
localized versions have changed the filenames and key names to be in the locale language.

The 'search' and 'domain' found something with no values though... mmmm, perhaps your work machine
will show something different.

(in reply to cortez_)
Post #: 16
RE: DHCP and resolv.conf - Apr. 13, '05, 2:30:24 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
Nothing new, it's the same localizeg windows version except that it has the SP2 applied and the output is exactly the same. Can you give me a hint form where this tries to resolve this information? From some registry key?

(in reply to Rodney)
Post #: 17
RE: DHCP and resolv.conf - Apr. 13, '05, 10:42:36 PM   
markfunk

 

Posts: 673
Joined: Mar. 31, '03,
Status: offline
Gregorio:
Did you get a chance to try mkresolv-conf.exe on your non-english systems ?
Just curious how well it works.

thanks, mark

(in reply to cortez_)
Post #: 18
RE: DHCP and resolv.conf - Apr. 13, '05, 11:06:25 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> From some registry key?

That's one of the places. There are several places to try to grab the information.
In a typical method MS seems to have it in several places and these several places
aren't always valid/active. Sheesh! But we might at least see what MS has selected
as the Polish word for "domain", "nameserver" and "searchlist". My code hunts around
in several different places. But we'll start at one spot and work from there.

Try looking in HKLM\System\CurrentControlSet\Services\Tcpip\Parameters
for the words. There should have one or more of the 3 magic words (translated to Polish
of course). Let us know what you find (or don't find). Then we can go to some of the
other places to pull up the information. Don't expect to find valid information
at this location all of the time. But this is the best spot to find these 3 words/keys.

< Message edited by Rodney -- Apr. 13, '05, 11:07:33 PM >

(in reply to markfunk)
Post #: 19
RE: DHCP and resolv.conf - Apr. 14, '05, 2:15:05 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
mkresolv-conf.exe works fine it gets the neccesary info about nameservers and returns it in a form of resolv.conf contents.

For the registry keys have a look at some dumps from the register - see the values for DhcpNameServer - key names are NOT translated but DIFFERENT! - see the dumps below:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"NameServer"=""
"Domain"=""
"Hostname"="pcbprzybylski"
"SearchList"=""
"DhcpDomain"="teatralne.comarch"
"DhcpNameServer"="10.10.1.5 10.132.0.150"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{9F54FF96-69E3-4BE3-A909-6A734B1B9681}]
"DefaultGatewayMetric"=hex(7):00,00
"NameServer"=""
"Domain"=""
"DhcpServer"="10.10.1.5"
"IPAutoconfigurationAddress"="0.0.0.0"
"IPAutoconfigurationMask"="255.255.0.0"
"DhcpIPAddress"="10.132.18.93"
"DhcpSubnetMask"="255.255.255.192"
"DhcpNameServer"="10.10.1.5 10.132.0.150"

(in reply to Rodney)
Post #: 20
Page:   [1] 2   next >   >>
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> DHCP and resolv.conf Page: [1] 2   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.109