Nameserver or hostname problem?

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
frisil
Level 3
Level 3
Posts: 146
Joined: Wed Feb 04, 2009 10:24 pm

Nameserver or hostname problem?

Post by frisil »

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!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
optimize me

Re: Nameserver or hostname problem?

Post by optimize me »

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!
frisil
Level 3
Level 3
Posts: 146
Joined: Wed Feb 04, 2009 10:24 pm

Re: Nameserver or hostname problem?

Post by frisil »

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?
optimize me

Re: Nameserver or hostname problem?

Post by optimize me »

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.
frisil
Level 3
Level 3
Posts: 146
Joined: Wed Feb 04, 2009 10:24 pm

Re: Nameserver or hostname problem?

Post by frisil »

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...
optimize me

Re: Nameserver or hostname problem?

Post by optimize me »

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?
frisil
Level 3
Level 3
Posts: 146
Joined: Wed Feb 04, 2009 10:24 pm

Re: Nameserver or hostname problem?

Post by frisil »

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!
optimize me

Re: Nameserver or hostname problem?

Post by optimize me »

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.....
frisil
Level 3
Level 3
Posts: 146
Joined: Wed Feb 04, 2009 10:24 pm

Re: Nameserver or hostname problem?

Post by frisil »

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 ;) )
Locked

Return to “Beginner Questions”