How can I enable CentOS to find, not just broadcast, "local" domain?

Issues related to software problems.

How can I enable CentOS to find, not just broadcast, "local" domain?

Postby myudkowsky2 » 2012/02/15 17:12:55

Question: How can I enable CentOS to find, not just broadcast, machines in the "local" domain?

Background:

On both MacOS and Debian, once I install avahi-daemon, I'm pretty much done with all configuration. All machines can ping each other using ".local" addresses.

I can't get this to work within CentOS itself. That is, let's say I have two machines, one called "nonCent" and the other called "yesCent."

From nonCent, I can successfulloy:
ping nonCent.local
ping yesCent.local
ping nonCent

I can't ping nonCent unless I specifiy the .local domain


From yesCent, I can only:
ping yesCent

I cannot ping nonCent, nonCent.local, or yesCent.local.

Both nonCent and yesCent have a nameserver in common, which is a router running the Tomato firmware. In particular,

Code: Select all
# cat /etc/resolv.conf
 ; generated by /sbin/dhclient-script
nameserver x.y.z.a


I'd like suggsetions on how to fix this. Please note that avahi-daemon is up and running on the CentOS systerm
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40

How can I enable CentOS to find, not just broadcast, "local"

Postby pschaff » 2012/02/15 19:12:41

Hostnames are never "broadcast". They must be provided by DNS or specified in /etc/hosts.

myudkowsky2 wrote:
...
I can't ping nonCent unless I specifiy the .local domain

Try adding append domain-search "local"; to /etc/dhclient.conf

# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver x.y.z.a

Is x.y.z.a the address of the router on the LAN or an external nameserver?

If more help is needed then please provide more information about your system by running "./getinfo.sh network" and showing us the output file.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Postby myudkowsky2 » 2012/02/15 20:26:19

pschaff,

Thanks for your reply.

First, here's an additional tidbit of information:

from my yesCent system, I can in fact see the nonCent system:
Code: Select all
# avahi-browse -D -lavt
+ eth0 IPv4 nonCent [mac address here]                  Workstation          local


so the problem I have -- that I can't "ping nonCent" and that I can't "ping nonCent.local" is even less understandable, because avahi-browse can find nonCent and correctly lists the domain as "local."

I'll try that new config on nonCent to append .local for the future.

To replay to your question about the obfusticated address,
Code: Select all
# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 1xx.yy.zz.a


1xx.yy.zz.a is the address of my router. It runs Tomato, and the router itself has the address of upstream providers. This config lets me provision my prefered namesever for all machines in the network.

Finally, the output of "getinfo network" is at myudkowsky config info
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Postby pschaff » 2012/02/15 22:22:25

There's really no reason to be obfuscating non-routing private IP addresses on the LAN. Only your public IP address is sensitive information.

Your route is messed up. There is no default gateway or link-local address. It should look something like:
Code: Select all
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Postby myudkowsky2 » 2012/02/15 22:29:05

Phil,

Thanks for the tip about non-routing IPs. I'll try to refrain after this series is over, but I'll keep the notation right now for consistency's sake.

In any case,

Code: Select all
# /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
1xx.yy.zz.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         1xx.yy.zz.a     0.0.0.0         UG    0      0        0 eth0


Which appears to be what I'd expect. Is there any other data I should be looking at? Ifconfig also looked normal.
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Postby pschaff » 2012/02/15 22:32:52

Apparently you edited something out of the script output as that looked different.

So, now I'm confused. Are all the systems on the same LAN, presumably something like 192.168.0.0/24? Can you ping by IP address rather than hostname?

By the way - for my example - to search "local" then something like:
Code: Select all
# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search local
nameserver 192.168.1.1
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Postby myudkowsky2 » 2012/02/15 22:42:24

Sorry for the confusion.

All of these are on the same network and share the same gateway, and a netmask of 255.255.255.0 lets me reach all machines.
avahi-browser from CentOS finds all the services and even the "local" domain name of nonCentOS.local.

I can ping from the CentOS server to non-CentOS servers if I use the IP address, but I can't ping using "ping nonCentOS.local" or "ping nonCentOS."
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Postby pschaff » 2012/02/16 02:15:47

Fix your DNS to use the server on the router.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Postby myudkowsky2 » 2012/02/16 13:29:20

To fix resolv.conf on a permanent basis, I've modified /etc/sysconfig/network-scripts/ifcfg-eth0 to include the line
Code: Select all
SEARCH="local"


I then did
Code: Select all
/etc/init.d/network restart


to regenerate /etc/resolv.conf, which now contains "search local" and then my local router as nameserver.

Even after a separate restasrt of avahi-daemon, I still cannot ping "local" domains ("nonCent.local") or machine names ("nonCent"). I can ping/resolve the addresses of machines outside my network, as before.

Any futhert suggestions would be ver welcome.
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40

Re: How can I enable CentOS to find, not just broadcast, "local" domain?

Postby myudkowsky2 » 2012/02/16 14:24:27

I've just run some further tests, and I have odd results.

A. avahi-browse on yesCent, to find itself:
Code: Select all
# avahi-resolve -v -n yesCent.local
Server version: avahi 0.6.16; Host name: yesCent.local
yesCent.local     <correct internal IP address>


If I then try to ping,
Code: Select all
# ping yesCent.local
ping: unknown host yesCent.local


For the nonCent machine, I get an IPv6 address from avahi-daemon:
Code: Select all
# avahi-resolve -v -n nonCent.local
Server version: avahi 0.6.16; Host name: yesCent.local
nonCent.local  <correct IPv6 address>


Ping to nonCent does not work, but perhaps that's because of the IPv6 address. ping's "-I" option doesn't work for me, probably because I don't know how to use it correctly, and ping6 on nonCent.local returns "unknown host." (ping6 from a third machine to nonCent does work.)

Finally, since adding search=local, I'm no longer able to "ping yesCent" from yesCent, and that used to work.
myudkowsky2
 
Posts: 14
Joined: 2012/02/15 16:41:40

Next

Return to CentOS 5 - Software Support

Who is online

Users browsing this forum: No registered users and 6 guests