Nameserver or hostname problem?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Nameserver or hostname problem?

Postby frisil on Wed Aug 19, 2009 6:46 pm

Hi,
I want to connect my Mint PC to a friend's nfs-network. When I plug it in there, I get an ip address by the router, it's different every time, so I want to use the hostname instead. However, Mint does not send the hostname to the router (fritz-box) correctly. See the picture to see what I mean: The two Pardus boxes (belonging to my friend) show up correctly by their hostnames, but my Mint box does not!

Any idea how to fix this? Thanks in advance!
Attachments
network.jpg
network.jpg (64.48 KiB) Viewed 635 times
User avatar
frisil
Level 3
Level 3
 
Posts: 116
Joined: Wed Feb 04, 2009 10:24 pm

Linux Mint is funded by ads and donations.
 

Re: Nameserver or hostname problem?

Postby optimize me on Wed Aug 19, 2009 7:54 pm

Two things:
1. Hostnames are resolved locally, in the hosts file located at /etc/hosts. (Unless your friends are running a local DNS system, which I find unlikely because if they knew how to run and keep up their own DNS, you all would already know why this doesn't work.)
2. NFS doesn't really use hostnames. Your friends need to export a directory or folder to you (or to the entire network). You need to mount their exported directory locally, either by putting an entry in fstab, or doing it manually. The fstab entry can use a hostname, but will work just as well with an IP. Same with a manual mount. Remember: NFS isn't like Samba in that it's not a browsable network setup; directories/folders have to be mounted before they're accessible.

Assuming you have RPC, Portmap, and nfs-common packages all installed and configured properly, and assuming your firewall is configured to allow NFS (ports 11, 2049, & 32771 IIRC) check the following:

The server should have a line similar to this in their /etc/exports
Code: Select all
/folder/to/export          192.168.1.XXX(rw,async,no_subtree_check)
where 192.168.1.XXX is, of course, the proper local address(es).

To mount manually, you will first need to run
Code: Select all
showmount -e <server>
to see which directories are being exported from the server. You can then manually mount it locally, like so:
Code: Select all
mount -t nfs server:/path/from/showmount /path/to/local/mountpoint
or add an entry to your fstab that automounts the exported folder any time you boot your system attached to their network. A typical line looks like:
Code: Select all
server:/path/to/export   /local/mout/point   nfs  rw,auto,user

Google an explanation on NFS mounts in fstab for more info on how to put that together to better suit your particular needs. NFS is one of the older file-sharing protocols around, and there is no shortage of information on how it works.

Good luck!
AMD Phenom II X6 1045T 2.8GHz 8GB DDR3 RAM ATI Radeon HD6970
User avatar
optimize me
Level 5
Level 5
 
Posts: 639
Joined: Wed Jun 03, 2009 5:25 pm

Re: Nameserver or hostname problem?

Postby frisil on Wed Aug 19, 2009 8:07 pm

Thanks, but I know how to mount nfs. Problem is, the ip of my computer changes, and the Pardus boxes can use each other's hostname to mount, while they have to mount my folders with my (ever changing) IP.

Could it be that Pardus runs its own local DNS System by default, so they can ID to each other (and to my computer!) by their hostnames? If so, how to set this up in Mint?
User avatar
frisil
Level 3
Level 3
 
Posts: 116
Joined: Wed Feb 04, 2009 10:24 pm

Re: Nameserver or hostname problem?

Postby optimize me on Wed Aug 19, 2009 8:20 pm

I'm not sure how a static IP is set up in network-manager, though I'm pretty sure I've read that it can be done.

I set up static IPs on my LAN by assigning them to particular mac addresses in my router configuration. If you don't want to hunt for a tutorial to setup up static IP in network-manager, maybe you could try that? NM is buggy and flakes out a lot for some people...

EDIT: Sorry if I seemed condescending at first, but you never know in these forums who knows what. You didn't mention exactly what you had done or what you had tried, so I figured we'd start at the beginning.
AMD Phenom II X6 1045T 2.8GHz 8GB DDR3 RAM ATI Radeon HD6970
User avatar
optimize me
Level 5
Level 5
 
Posts: 639
Joined: Wed Jun 03, 2009 5:25 pm

Re: Nameserver or hostname problem?

Postby frisil on Wed Aug 19, 2009 8:38 pm

No, you did not sound condescending at all, I just wanted to make sure no one else would spent valuable time by explaining things I already know. Sorry on my side for not making that clear in my post.

I cannot assign specific IPs to MAC-addresses in the fritz-box, or we can't find it. There has to be another solution...
User avatar
frisil
Level 3
Level 3
 
Posts: 116
Joined: Wed Feb 04, 2009 10:24 pm

Re: Nameserver or hostname problem?

Postby optimize me on Wed Aug 19, 2009 9:47 pm

Even if it's not static, your IP shouldn't be changing all that often.. A DHCP leased address should last anywhere from a few hours to two or three days, depending on the AP configuration.

Again, that's assuming everybody's working with defaults. If your pals know enough about networking to run without DHCP and run their own statics, it's odd that they can't set you up with one.

In any event, if your problem is that the AP gives you a different IP every time, for now I guess your stuck editing hosts files every time you use their network.

I don't use the default network-manager applet. I installed wicd - it gives more control over connection settings and gives more options. Maybe give that a spin and see if you can make your own static IP at that access point?
AMD Phenom II X6 1045T 2.8GHz 8GB DDR3 RAM ATI Radeon HD6970
User avatar
optimize me
Level 5
Level 5
 
Posts: 639
Joined: Wed Jun 03, 2009 5:25 pm

Re: Nameserver or hostname problem?

Postby frisil on Thu Aug 20, 2009 5:41 am

Yes, true, I have to edit hostfiles every time I go there and want to plug my laptop in. Getting a static IP would only be a workaround, I want my hostname to be sent to the router, it cannot be that difficult, even any windows pc plugged in there will do that automatically. There has to be some way to give Mint the same functionality as Pardus and even windows xp!
User avatar
frisil
Level 3
Level 3
 
Posts: 116
Joined: Wed Feb 04, 2009 10:24 pm

Re: Nameserver or hostname problem?

Postby optimize me on Thu Aug 20, 2009 6:08 am

frisil wrote:Yes, true, I have to edit hostfiles every time I go there and want to plug my laptop in. Getting a static IP would only be a workaround, I want my hostname to be sent to the router, it cannot be that difficult, even any windows pc plugged in there will do that automatically. There has to be some way to give Mint the same functionality as Pardus and even windows xp!

I found this thread from last year at Arch forums: http://bbs.archlinux.org/viewtopic.php?id=50881 Posts 3, 4 & 5 offer some clues.

Basically, once you're connected, try restarting dhclient and see what happens. Beyond that, it's down to editing settings in the router.

Maybe someone else can offer some ideas? I'm fresh out.....
AMD Phenom II X6 1045T 2.8GHz 8GB DDR3 RAM ATI Radeon HD6970
User avatar
optimize me
Level 5
Level 5
 
Posts: 639
Joined: Wed Jun 03, 2009 5:25 pm

Re: Nameserver or hostname problem?

Postby frisil on Thu Aug 20, 2009 1:00 pm

Thanks for all your help, but it's still unsolved- the files mentioned in the archlinux link (post1) do not exist in Mint, and the other clues (router being buggy) do not apply, because it works with Pardus and Windows, just not with Mint, Mepis, Sabayon and a few other distros.

I've found a workaround using avahi (by installing all packages having to do with it) now I can access the machine on another computer in the network via fysta.local:/ but still, this is just a workaround, fysta does not show up on the router nor can I use fysta:/ (fysta is my hostname, as you might have guessed ;) )
User avatar
frisil
Level 3
Level 3
 
Posts: 116
Joined: Wed Feb 04, 2009 10:24 pm

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: Ceilidh2, devsfan1830, Reorx, zuiko and 24 guests