Hello Everybody. I'm not sure if I should post this here or in the Linux forum. Here goes:


1 - I have a local Linux server (Mandriva 2010) with a WordPress blog in it. It's for testing.

2 - I have other 2 computers at home (both have Linux and Windows), all of them connected to the local network via a Speedtouch router.

3 - For PHP, MySQL, and Apache, I'm using XAMPP

4 - I want to access the blog from the other two computers.

5 - I can access the server from Windows either via IP or server name.

6 - Under Linux, I can only access the Blog via IP, if I use the server name, the browser goes stright to google and does a search using that name.

7 - I read on the Internet that I should do something to the router, but I don't know.

8 - I tried disabling the firewall on one computer running SuSE 11.4, the problem continued. Can't try the same on the other one because it is Linux Mint, and I don't know how to disable it's firewall :P

9 - I don't know if the problem is the router or the Linux configuration.

The problem is I need both Linux computers to be able to access the Blog via NAME, not IP.

The machines are perfectly connected: I can share files via SAMBA and across any OS. I can also access the other platforms I have installed in the server: Joomla and Drupal (I have them all installed in the server).


I appreciate any help.

Dani AI

Generated

Quick summary and why the fix worked: Windows clients were resolving the server name with NetBIOS/WINS (that behavior is built into Windows and many home routers), while the Linux desktops used the OS name‑service stack that didn’t include NetBIOS lookups by default. Enabling WINS name resolution on the Linux clients (the winbind/libnss integration that pointed to) made the Linux clients resolve the same short name the Windows machines already did — which is what fixed ’s problem. (samba.org)

Other, non‑overlapping options for similar setups:

  • Quick-and-dirty: keep the hosts file entries on clients (works for tiny static networks but needs manual updates when the server IP changes).
  • Zero‑conf: use mDNS/Avahi so the server is reachable as hostname.local without editing hosts or Samba. Avahi + the nss‑mdns module is the normal Linux approach for .local names. (wiki.archlinux.org)

Helpful checks/examples (examples of commands useful when diagnosing name resolution):

getent hosts servername
nmblookup servername
avahi-resolve -n -4 servername.local

Router/DNS approach and WordPress note: many home routers (or a small dnsmasq instance on the server/router) can publish DHCP hostnames so every client sees an A record for the server; this is the most scalable option if the server IP can change. For a WordPress test site, the WordPress Address and Site Address settings are significant — if WordPress is configured to use a particular host it will redirect to that host, so the site URL should match the chosen hostname (or be overridden via wp-config if the site is only for local testing). (dnsmasq.org)

Short troubleshooting checklist: confirm the winbind service is running when relying on WINS, confirm relevant firewall ports (NetBIOS/WINS and mDNS) aren’t blocked, and use the commands above to verify which resolver (hosts, WINS, DNS, or mDNS) answers the query. (samba.org)

Recommended Answers

All 4 Replies

A quick and dirty way to have the two local computers find the linux boxes would be to add entries in the hosts file on the windows systems. Windows uses a file normally located at

C:\windows\system32\drivers\etc\hosts

This is the windows equivalent of the /etc/hosts file on Linux systems. On my systems at home I have added a link to a testing server I run and the file looks 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
# 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:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
# localhost name resolution is handled within DNS itself.

127.0.0.1    localhost
#         Any other entries you had go here (new line no # no space);  

192.168.0.2   srvr4   srvr4.txlinux.com

Normal syntax for the file is:

IP Address <TAB> short_name <TAB> Fully qualified Domain Name

You can then get to the server by putting either the short_name or the full name in your Navigation or Location area:


or
http://srvr4.txlinux.com/page1.html

Thank you for your prompt reply. However, I do not understand something: my blog is hosted on a local LINUX server and the WINDOWS clients can access it via IP AND NAME. So it's working wonderfully in a Linux (server) - Windows (client) environment. The problem is that Linux CLIENTS can only access the LINUX server using the IP.

Should I then change the Windows hosts (that's what I understood in your reply, correct me if I'm wrong).

Hello,

My mistake I was thinking it was the windows systems that cannot access via name. In this case all you need to do is edit the /etc/hosts file on the linux clients and add in the entries for the windows servers.
Basically the hosts file is the first place that the system looks for DNS entries. If it does not find one then it queries the DNS server and if that fails the WINS server (if one is listed.) You can either add entries to the hosts file of start the wins client on the Linux servers.

Depending on your configuration you set up wins something along these lines.

To enable WINS resolution in Ubuntu, do the following:

Edit the /etc/nsswitch.conf file, and change this line:

hosts: files dns

to this:

hosts: files wins dns

Then do a sudo aptitude install winbind to install winbind, and everything should work like a charm.

Thank you very much, rch1231. It worked like a charm.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.