LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Cannot resolve intranet computers by name (https://www.linuxquestions.org/questions/linux-networking-3/cannot-resolve-intranet-computers-by-name-52886/)

arobinson74 04-01-2003 11:39 AM

Cannot resolve intranet computers by name
 
Network setup:

Linux (eth0 on DHCP to AT&T Broadband cable modem, eth1 set to 192.168.0.1 and configured with DHCPD)

2 Windows computers (WinME, WinXP).

The windows comptuers are seeing the network fine and can see the linux machine. So Samba is working great.

The problem is that the computers (windows) cannot be resolved to IPAddresses.

Example, my XP box is called "Andrew"
ping andrew
this results in "ping: unknown host andrew"

Because I used to use Microsoft internet connection sharing as my gateway before I switched to linux the windows computers are using domain name 'mshome.net'

I've tried to go into the DNS configuration and add support for this domain, but I am not doing something right.

If the internal computers weren't using DHCP from Linux, I know I could hard code their name/IP in the hosts file, but would rather not.

What do I need to do to have linux resolve the windows computer names to IPAddresses so I can use computer names when on my linux box?

jamrock 04-01-2003 12:00 PM

Give me some info. re: your DNS setup:

How did you install it?

What does your /etc/named.conf file look like?

What do your zone files look like?

arobinson74 04-01-2003 12:14 PM

How did you install it?
I had Linux initially set it up, then I used the UI and the DNS setup to modify it (not sure I did it correctly, probably not)

Code:

What does your /etc/named.conf file look like?
[root@linux root]# cat /etc/named.conf
## named.conf - configuration for bind
#
# Generated automatically by redhat-config-bind, alchemist et al.
# Any changes not supported by redhat-config-bind should be put
# in /etc/named.custom
#
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

include "/etc/named.custom";

include "/etc/rndc.key";

options {
        directory "/var/named/";
};

zone  "0.0.127.in-addr.arpa" {
        type master;
        file  "0.0.127.in-addr.arpa.zone";
};

zone  "localhost" {
        type master;
        file  "localhost.zone";
};
zone  "mshome.net" {
        type master;
        file  "mshome.net.zone";
};

Contents of named.custom:
## named.custom - custom configuration for bind
#
# Any changes not currently supported by redhat-config-bind should be put
# in this file.
#

zone  "." {
        type hint;
        file  "named.ca";
};


Contents of 0.0.127...
$TTL 86400
@      IN      SOA    localhost.      root.localhost (
                        1 ; serial
                        28800 ; refresh
                        7200 ; retry
                        604800 ; expire
                        86400 ; ttk
                        )


@      IN      NS      localhost.

1      IN      PTR    localhost.

Contents of localhost.zone
$TTL 86400
@      IN      SOA    @  root.localhost (
                        1 ; serial
                        28800 ; refresh
                        7200 ; retry
                        604800 ; expire
                        86400 ; ttl
                        )


@      IN      NS      localhost.


@      IN      A      127.0.0.1

Contents of mshome.net.zone
$TTL 86400
@      IN      SOA    @  root.localhost (
                        2 ; serial
                        28800 ; refresh
                        7200 ; retry
                        604800 ; expire
                        86400 ; ttl
                        )


@      IN      NS      localhost


mlp68 04-01-2003 01:29 PM

try if you can resolve the fully qualified hostname andrew.mshome.net instead of just andrew.

If you can, you need to add

search mshome.net

to /etc/resolv.conf on linux. For the dhcp'ed boxes on your private network, you'd need to add

option domain-name "mshome.net";

to the conf file.

Give it a shot.

mlp

arobinson74 04-01-2003 02:10 PM

Tried that, sill no dice.

Also:
ping linux.mshome.net
Doesn't work either (linux is the name of my linux box).

bentz 04-01-2003 02:28 PM

I believe you need to add more entries to your 'mshome.net.zone' file. If you append
'
andrew 1D A 192.168.0.2
bentz 1D A 192.168.0.3
cats 1D A 192.168.0.4
dogs 1D A 192.168.0.5
'
to the end of your 'mshome.net.zone' file and restart named (using /etc/rc.d/init.d/named restart) you will be able to resolve andrew.mshome.net to 192.168.0.2, bentz.mshome.net to 192.168.0.3, and so forth. Use 'nslookup' to check these names as opposed to ping (it should provide better info). You will need to define a 'search' parameter of 'mshome.net' in /etc/resolv.conf to be able to resolve simply 'andrew' instead of 'andrew.mshome.net', mlp68 states.

Also, check out your /etc/hosts. You say that you can't resolve 'linux' and you ought to be able to do that even if named has crashed and burned. /etc/hosts should look like:
127.0.0.1 localhost.localdomain localhost
192.168.0.1 linux.mshome.net linux

One final thing, check out /etc/sysconfig/network and ensure that you have a 'HOSTNAME=linux' line somewhere in there.

I hope all this gets you on the right track!

arobinson74 04-01-2003 04:13 PM

I agree that that solution would work, but it would negate DHCP. So if I have a computer on my intranet, it will not always get the same IP Address since I am using DHCPD to assign IPs to my intranet computers. So if I said "Andrew" is 192.168.0.2 and the linux box assigns xxx.3 instead, the lookup will no longer work. Hoping to find a way to keep DHCP as the method of assigning IPs to my intranet computers, but still be able to host name translate the computers from linux.

jamrock 04-01-2003 08:21 PM

Okay,

I haven't had a chance to look at your zone files in any detail. (Need to get some sleep first). My concern is similar to the one that Bentz has.

I would expect to see a reference to at least the DNS machine in your mshome.net.zone file. The i.p. address of the DNS machine needs to be static so that you can tell the others where to find it.

Add it to the file and see if you can ping it by name.

If you can, half the battle is won. We could then be sure that DNS is working. All we would have to do is to set up dynamic updates. There are a few security issues of which you need to be aware.


I found some good links to setting up Bind in a Windows environment. I will pass those on tomorrow. BTW what version of Bind are you using?

arobinson74 04-02-2003 10:24 AM

Okay, made the change, and now am getting nslookup information on linux.mshome.net.

The output of nslookup for andrew looks like this:
> andrew
Server: linux.mshome.net
Address: 192.168.0.1#53

** server can't find andrew: NXDOMAIN

Bind: (rpm -q bind) bind-9.2.1-9

arobinson74 04-02-2003 10:30 AM

BTW the same nslookup from windows looks like this:

C:\>nslookup andrew
*** Can't find server name for address 192.168.0.1: Non-existent domain
*** Default servers are not available
Server: UnKnown
Address: 192.168.0.1

*** UnKnown can't find andrew: Non-existent domain

C:\>nslookup andrew.mshome.net
*** Can't find server name for address 192.168.0.1: Non-existent domain
*** Default servers are not available
Server: UnKnown
Address: 192.168.0.1

*** UnKnown can't find andrew.mshome.net: Non-existent domain

bentz 04-02-2003 11:58 AM

Your zone files need an entry for 192.168.0.1, so that the DNS server can resolve itself. The fact that it is coming up UnKnown is troublesome. Once the DNS server can resolve itself, you will have some chance of getting it to resolve other names, like 'andrew.mshome.net'

Note that you must always use the FQDN for your nslookup queries. 'andrew' is not going to work in nslookup unless you type 'srchlist=mshome.net' first. Eventually you will be able to resolve 'andrew' using the search domain 'mshome.net' from your DHCP server, but you're not quite there yet, I suspect.

Perhaps you should use WINS instead. I hate to suggest a Microsoft-propietaty protocol, but the manner in which you want to resolve hosts with Windows using DHCP fits into the WINS-scope. Examine the documentation for Wins-server on Samba if you decide to take that route instead.

arobinson74 04-02-2003 02:12 PM

I have the search list in the resolve.conf, so it will find linux and linux.mshome.net find from windows. It is now just the windows computers that are not being found. The zone file now has
the DNS server:

mshome.net.zone
$TTL 86400
@ IN SOA linux.mshome.net. root.localhost (
2 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttl
)


@ IN NS 192.168.0.1


@ IN A 192.168.0.1
linux IN A 192.168.0.1



Looks like maybe some redundant data, not sure. This was made by the GUI config tool (perhaps I should learn the file method).

bentz 04-02-2003 02:30 PM

resolv.conf has nothing to do with Windows... The search domain for Windows is defined in the Network Control Panel (depending on which Windows) under Advanced, DNS, 'DNS Suffix for this connection:'. resolv.conf only controls the search domain function from the Linux nslookup...

That info is not redundant. The line with NS specifies the NameServer, while the A line specifies the record for the host itself. The line with SOA defines the Start Of Authority for the DNS zone 'mshome.net'.

You don't have any other hosts defined besides 'linux', so you won't be able to resolve any Windows machines until you add each Windows machine's computer name and IP address into your mshome.net.zone file.

I've never used any GUI tools to configure this stuff, but this file looks proper to me...

bentz 04-02-2003 02:31 PM

Whoops, I forgot that if you are delivering the search domain via DHCP, there will not be an assignment in the Network Control Panel location on the Windows clients as I stated above.

arobinson74 04-02-2003 05:39 PM

Found a problem in the messages log:

Apr 2 16:35:41 linux dhcpd: Wrote 0 new dynamic host decls to leases file.
Apr 2 16:35:41 linux dhcpd: Listening on LPF/eth1/xx:xx:xx:xx:xx:xx/192.168.0.0/24
Apr 2 16:35:41 linux dhcpd: Wrote 1 leases to leases file.
Apr 2 16:35:41 linux dhcpd: Listening on LPF/eth1/xx:xx:xx:xx:xx:xx/192.168.0.0/24
Apr 2 16:35:41 linux dhcpd: Sending on LPF/eth1/xx:xx:xx:xx:xx:xx/192.168.0.0/24
Apr 2 16:35:41 linux dhcpd: Sending on LPF/eth1/xx:xx:xx:xx:xx:xx/192.168.0.0/24
Apr 2 16:35:41 linux dhcpd:
Apr 2 16:35:41 linux last message repeated 2 times
Apr 2 16:35:41 linux dhcpd: No subnet declaration for eth1 (0.0.0.0).
Apr 2 16:35:41 linux dhcpd: ** Ignoring requests on eth1. If this is not what
Apr 2 16:35:41 linux dhcpd: No subnet declaration for eth1 (0.0.0.0).
Apr 2 16:35:41 linux dhcpd: ** Ignoring requests on eth1. If this is not what
Apr 2 16:35:41 linux dhcpd: you want, please write a subnet declaration
Apr 2 16:35:41 linux dhcpd: in your dhcpd.conf file for the network segment
Apr 2 16:35:41 linux dhcpd: you want, please write a subnet declaration
Apr 2 16:35:41 linux dhcpd: to which interface eth1 is attached. **
Apr 2 16:35:41 linux dhcpd: in your dhcpd.conf file for the network segment
Apr 2 16:35:41 linux dhcpd: to which interface eth1 is attached. **
Apr 2 16:35:41 linux dhcpd:
Apr 2 16:35:41 linux dhcpd: Sending on Socket/fallback/fallback-net
Apr 2 16:35:41 linux dhcpd:
Apr 2 16:35:41 linux dhcpd: Sending on Socket/fallback/fallback-net
Apr 2 16:35:41 linux dhcpd: dhcpd startup succeeded


Looks like for some reason it is not liking my dhcpd.conf line of
subnet 192.168.0.0 netmask 255.255.255.0


All times are GMT -5. The time now is 11:51 AM.