# My hostname problem... [SOLVED]

## Sniper991122

alright, so this is kind of part of another thread but since thats dead and I've 'cleaned up' my question here it is...

http://img.photobucket.com/albums/v638/Sniper991122/Screenshotcopy.jpg

If you look at that picture it should show my problem pretty clearly... the laptop is named 'rlaptop', Sniper is my desktop and MelissaComputer is my moms desktop....

My router is running dd-wrt, 3rd party firmware for the linksys 54G wireless router... it is running linux, and it IS running DNS MASQ... (since was suggested to help fix the problem)

the problem I have is im trying to get samba working and if I have a name to associate with the IP address it would be much much easier... and sine its DHCP the ip address changes.. fun... any help?Last edited by Sniper991122 on Tue May 30, 2006 6:32 am; edited 1 time in total

----------

## troymc

2 suggestions:

1) make sure the laptop has it's hostname set correctly everywhere: /etc/conf.d/hostname, /etc/hosts and make sure /etc/hostname does not exist. (it over-rules the conf.d file)

2) If that does not help, try setting your dhcp client to specifically send a hostname when it requests an IP.  If you are using dhcpcd then add a line like this in /etc/conf.d/net in your wlan0 configuration:

```

dhcpcd_wlan0="-h rlaptop"

```

troymc

----------

## Sniper991122

added #2 to the net file, restarted and still see nothing in the router... heres my hostname/hosts file incase im missing something...

hostname

```
#HOSTNAME='rlaptop'

HOSTNAME='rlaptop'
```

hosts

```

127.0.0.1         rlaptop.connected          rlaptop

::1          localhost
```

there is no /etc/hostname file, so that rules that out...

----------

## jmbsvicetto

Hi.

Just a warning, you shouldn't replace the 127.0.0.1 localhost entry. That might give you problems. Your host entry should also use your ip address, but if you're using DHCP, you should probably skip that entry. So your /etc/hosts should be:

```
127.0.0.1         localhost

::1          localhost
```

----------

## Sniper991122

I had that problem earlier when I changed all the localhost's to rlaptop, (and I do use DHCP) but leaving that last one as localhost seemed to fix the problem and thats the advice I was given in an earlier thread trying to remedy this problem...Last edited by Sniper991122 on Mon May 29, 2006 6:53 pm; edited 1 time in total

----------

## troymc

Actually, you should merge those 2.    :Very Happy: 

```

127.0.0.1        rlaptop.connected        rlaptop   localhost

```

That gives it a FQDN of rlaptop.connected and 2 aliases/nicks rlaptop & localhost

troymc

----------

## Sniper991122

merged and still an empty hostname in the router....   :Sad: 

----------

## troymc

 *Sniper991122 wrote:*   

> merged and still an empty hostname in the router....  

 

 :Sad: 

Don't suppose there are any logs on that router?

Show us your /etc/conf.d/net & /etc/conf.d/wireless

You did bounce the interface after adding that dhcpcd_wlan0="-h rlaptop" line, right?

Try dropping the interface, make sure dhcpcd is stopped, remove /etc/dhcpc/dhcpcd-wlan0.info & /etc/dhcpc/dhcpcd-wlan.cache, and bringing the interface back up.

When the interface is up, show us /etc/dhcpc/dhcpcd-wlan0.info & /etc/dhcpc/dhcpcd-wlan.cache

troymc

----------

## Sniper991122

I just enabled logging for the router, so theres no log as of yet.. something to look at later...

net consists of "dhcpcd_wlan0="-h rlaptop".. upon starting up since there is nothing else in there it assumes im using dhcpc and goes from there..

also, the wireless file does not exist yet.. when I start up i just type 'dhcpcd wlan0' to assign an IP address.... also, under /etc/ I see no dhcpc folder..

in addition to that, I am fairly new to gentoo so you could elaborate on what you mean by bouncing and dropping the interface?  :Smile: 

----------

## troymc

 *Sniper991122 wrote:*   

> I just enabled logging for the router, so theres no log as of yet.. something to look at later...
> 
> net consists of "dhcpcd_wlan0="-h rlaptop".. upon starting up since there is nothing else in there it assumes im using dhcpc and goes from there..
> 
> also, the wireless file does not exist yet.. when I start up i just type 'dhcpcd wlan0' to assign an IP address.... also, under /etc/ I see no dhcpc folder..
> ...

 

OK!    :Very Happy: 

Actually first, what you just said explains alot!  You are not using the normal network config stuff, so no wonder changes to the normal configs don't work!   :Laughing: 

So, to test this, instead of dhcpcd wlan0, try running dhcpcd -h rlaptop wlan0.

On Gentoo, you bring interfaces up & down using /etc/init.d/net.<IF> start/stop. Where <IF> is your interface name - in this case wlan0: /etc/init.d/net.wlan0.

Now this script won't exist to begin with, you need to create it by simply creating a link to net.lo

```
ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0
```

Then you will need to setup your /etc/conf.d/net & /etc/conf.d/wireless files for your connection.

Then you can bring your connection up & down by simply executing:

```

/etc/init.d/net.wlan0 start

/etc/init.d/net.wlan0 stop

```

troymc

----------

## Sniper991122

alright, after linking net.lo with wlan0, stopping dhcpcd and then using dhcpcd -h rlaptop wlan0, rlaptop now shows up in the router for the hostname... thats good.. however, on my desktop when i type in 'ping rlaptop' i get the response that it could not find the host....

any ideas for this? (pinging the IP address it was assigned works perfectly fine) (also for reference, the gentoo laptop can ping the desktop Sniper which uses a wireless usb nic)

im following the manual now for setting up /net and /wireless....

----------

## troymc

 *Sniper991122 wrote:*   

> alright, after linking net.lo with wlan0, stopping dhcpcd and then using dhcpcd -h rlaptop wlan0, rlaptop now shows up in the router for the hostname... thats good.. 

 

Good! progress!    :Very Happy: 

 *Sniper991122 wrote:*   

> 
> 
> however, on my desktop when i type in 'ping rlaptop' i get the response that it could not find the host....
> 
> any ideas for this? (pinging the IP address it was assigned works perfectly fine)
> ...

 

Ok, that's name resolution. What are you using for DNS?  Is your router a DNS server, too?  Or are you using your ISPs nameservers? If you are using your ISPs DNS servers then what you want to do cannot be done.  If your router is your DNS server, then you need to enable dynamic DNS updates, somehow.  That way, it's DHCP server updates its DNS server with the new address/hostname info.

troymc

----------

## Sniper991122

okay, the DNS Masq under the router has a Local DNS option...

so, I enabled Local DNS which should give me a static hostname? it does go on further with additional dns options...

```
Additional DNS Options. For example :

    * static allocation : dhcp-host=AB:CD:EF:11:22:33,192.168.0.10,myhost,myhost.domain,12h

    * max lease number : dhcp-lease-max=2

    * DHCP server IP range : dhcp-range=192.168.0.110,192.168.0.111,12h

```

specifically, theres an example from the router... with local DNS turned on im still not able to ping 'rlaptop'.. am I missing something here?

----------

## troymc

 *Sniper991122 wrote:*   

> okay, the DNS Masq under the router has a Local DNS option...
> 
> so, I enabled Local DNS which should give me a static hostname? it does go on further with additional dns options...
> 
> ```
> ...

 

Ok, that looks promising.  You need to make sure that your systems are using this DNS server and not your ISPs.

Check /etc/resolv.conf and look at the nameserver lines.  It should show your ISPs nameservers.

Then bounce your interface ( you've configured you net & wireless stuff by now, right?   :Very Happy:  ).

Check /etc/resolf.conf again, and hopefully it is now showing your router as the nameserver.

My hope here is that since you've enabled local DNS, the router is smart enough to know to push it as a nameserver for DHCP clients.  So you merely need to re-dhcp and get the up to date info.

troymc

----------

## Sniper991122

did that, and resolv.conf displays

```
# Generated by dhcpcd for interface wlan0

nameserver 192.168.1.1

```

so im assuming then that router isn't smart enough?

----------

## troymc

 *Sniper991122 wrote:*   

> did that, and resolv.conf displays
> 
> ```
> # Generated by dhcpcd for interface wlan0
> 
> ...

 

Actually, that looks good.  Isn't that the IP of your router? That sure doesn't look like an ISP nameserver.

Can you still resolve external hostnames?  (ie. www.google.com)

Now check the DHCP configuration of the router & see if there's an option to dynamically update the DNS server.

troymc

----------

## Sniper991122

still able to resolve host names like www.google.com

and there is no option to dynamically update the DNS server, the closest thing is Local DNS which is described as

Local DNS enables DHCP clients on the LAN to resolve static and dynamic DHCP hostnames... im assuming it would take care of that itself? (checked everywhere in the router)

----------

## troymc

 *Sniper991122 wrote:*   

> still able to resolve host names like www.google.com
> 
> and there is no option to dynamically update the DNS server, the closest thing is Local DNS which is described as
> 
> Local DNS enables DHCP clients on the LAN to resolve static and dynamic DHCP hostnames... im assuming it would take care of that itself? (checked everywhere in the router)

 

Yep, that should be it.

But no joy, huh?   :Sad: 

Where are you trying to resolve the laptops hostname from?  Another box on the network? Have you renewed its dhcp lease to get the up to date DNS info?

troymc

----------

## Sniper991122

yeh, I've got my windows desktop (SNIPER) sitting 2 inches from my gentoo laptop (rlaptop).... as soon as I get all of the kinks worked out on the laptop, i'll begin the installation of Gentoo on my desktop   :Very Happy: 

in my router, I do however have 3 boxes to choose Static DNS addresses... im tempted to put one in and use it for the laptop but im not sure how to assign it to a specific computer....

let me get a screenshot real quick, I might have found something...

----------

## troymc

 *Sniper991122 wrote:*   

> yeh, I've got my windows desktop (SNIPER) sitting 2 inches from my gentoo laptop (rlaptop).... as soon as I get all of the kinks worked out on the laptop, i'll begin the installation of Gentoo on my desktop   

 

What is its DNS set at?  Have you renewed its dhcp lease?

```

ipconfig /release

ipconfig /renew

```

troymc

----------

## Sniper991122

right, forgot to mention that I did release/renew and still with no results... =\

heres the screenshot...

http://img.photobucket.com/albums/v638/Sniper991122/Screenshot-1.gif

I noticed under 'Local DNS' its empty... should this be assigned to 192.168.1.1?

alternatively, there is the 3 Static DNS boxes below that, I could always try and use that with the laptop if all else fails...

----------

## troymc

 *Sniper991122 wrote:*   

> right, forgot to mention that I did release/renew and still with no results... =\
> 
> heres the screenshot...
> 
> http://img.photobucket.com/albums/v638/Sniper991122/Screenshot-1.gif
> ...

 

I don't think either of those is what you want. The top section is the network settings for the router itself. That local DNS option is probably if you have your own DNS server running on the network. And the 3 statics are options to hand out to your clients. But your clients already have the correct DNS server (192.168.1.1).

Try going to Administration --> Services and make sure DHCP daemon is enabled.

troymc

----------

## Sniper991122

hmm.. when i go to admin>services i have four options, samba, xdm, cupsd and sshd... when I go to the help it shows a completely different box with different options... in the command typing services-admin brings up this same box...

also, I have F@H installed as a service that does boot up with the OS and im assuming that would be in there... am I in the wrong area or something?

(thanks for your patience and help btw)

----------

## troymc

 *Sniper991122 wrote:*   

> hmm.. when i go to admin>services i have four options, samba, xdm, cupsd and sshd... when I go to the help it shows a completely different box with different options... in the command typing services-admin brings up this same box...
> 
> also, I have F@H installed as a service that does boot up with the OS and im assuming that would be in there... am I in the wrong area or something?
> 
> (thanks for your patience and help btw)

 

Hmmm...Do you know what version of dd-wrt you are using?  I was looking here:

http://wrt-wiki.bsr-clan.de/index.php?title=DNSMasq_as_DHCP_server

troymc

----------

## Sniper991122

oh the router ;p I was looking in Gnome for some reason.. hah...

im running the latest version of dd-wrt released probably a week or two ago... and the DHCP Daemon is enabled...

----------

## troymc

 *Sniper991122 wrote:*   

> oh the router ;p I was looking in Gnome for some reason.. hah...
> 
> im running the latest version of dd-wrt released probably a week or two ago... and the DHCP Daemon is enabled...

 

Hmmm...in that same section, do you see a Local DNS option?  If so enable that.

Why would they have 2 different things called Local DNS??

That's just mean!    :Twisted Evil: 

troymc

----------

## Sniper991122

under admin>services there is no other local DNS feature.... I did at least assign a static IP to anycomputer that connects the router as 'rlaptop' so thats something to work with...

----------

## troymc

Sorry, try Administration --> Management --> DNSMasq

Did setting it statically allow you to resolve the hostname?

troymc

----------

## Sniper991122

DNSMasq was where I originally turned on Local DNS.. thats why I figured it would have given it that name by then...

although this option under Local DNS has additionl DNS options where i posted their examples...

```
 There are some extra options you can set by entering them in Additional DNS Options. For example :

    * static allocation : dhcp-host=AB:CD:EF:11:22:33,192.168.0.10,myhost,myhost.domain,12h

    * max lease number : dhcp-lease-max=2

    * DHCP server IP range : dhcp-range=192.168.0.110,192.168.0.111,12h

```

i basically did the static allocation (just a different way than through dns masq) and at least now I have a concrete IP for that laptop... no hostname though..

----------

## troymc

Hmmm....well I'm clueless at this point.

Maybe we're hitting that DNSMasq bug they talk about here:

http://wrt-wiki.bsr-clan.de/index.php?title=DNSMasq_as_DHCP_server

You might try posting on one of their forums.

troymc

----------

## Sniper991122

yeh that sounds promising... thanks for getting me this far, just wish it were a little easier of a problem  :Sad: 

im glad I at least got a static IP for the laptop that gives me something solid to work with...

----------

## Sniper991122

update... so... oddly enough.. I was tinkering around with samba (getting it to work) and on my windows pc i ended up typing in

net use m: \\rlaptop\anonymous  (instead of the IP address) and it prompted me for a password...

so, i typed in ping rlaptop.. and voila im getting a response?

looks like something worked   :Very Happy: 

----------

## troymc

Excellent! Congrats!

I have a feeling that we just needed to let caches & such timeout & renew.

troymc

----------

