View previous topic :: View next topic |
Author |
Message |
lonepie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 30 Mar 2006 Posts: 9
|
Posted: Thu Mar 30, 2006 5:34 am Post subject: Hostname annoyance on Gentoo Router |
|
|
Hello! I've been searching the forums for quite some time now looking for a fix for this issue, forgive me if it has been covered already.
I have my gentoo box setup as a router/gateway for my home network on Comcast cable. I've set it up using Squid, Iptables, and dnsmasq, which are all working brilliantly. My only concern is that the box's hostname gets changed to one supplied by Comcast. Well, I'm also using samba and apache on the box and I frequently access it from my windows machine (which is my primary workstation). In the past, I would just have to type \\linux (my simple LAN hostname) to access the box over samba, or http://linux for apache. This is no longer the case. I now have to type \\c-##-###-###-###.hsd1.pa.comcast.net or the same with http:// to access the box. I played around in the dnsmasq conf and made it so it'll forward all "linux" hostname requests to the box, which is working... however, when I try to access http://linux:901 (for swat) the dns tries to go to http://www.linux.com.
Ok.. that bothers me! I figured out that my iptables wasn't allowing connections to port 901. After allowing LAN access to 901, I was able to access swat by using http://linux:901, but it should NOT even try to go to www.linux.com in the first place.
Further clarification: before I fixed the access through IPtables, I could do: http://c-##-###-###-###.hsd1.pa.comcast.net:901 and I would get the appropriate "Page not found" response from my browser, whereas doing http://linux:901 brings me to www.linux.com:901 and a blank page.
I remember on my old ISP, the hostname would also change, but I could still access the "internal" hostname 'linux' like normal.. I wasn't using squid or dnsmasq then, so I suspect either of the two as being the culprit.
Ok, any ideas? If you need me to supply any confs, let me know...
Thanks! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
badchien Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Simpsons/simpsons_santas_little_help.gif)
Joined: 16 Feb 2004 Posts: 415 Location: doghouse
|
Posted: Thu Mar 30, 2006 6:05 am Post subject: |
|
|
I guess you are accessing your gentoo server from a windows pc, since you are using samba. In this case then your pc is trying to find the server by "netbios" name when you enter that in the address bar.
Look at your samba config (/etc/samba/smb.conf) and see if netbios name is set. I'm guessing it isn't, because it defaults to the machine's hostname, and that is your problem. Set netbios name to "linux" and restart samba and that should solve your problem.
If you don't want the dhcp supplied hostname clobbering your own hostname for the server, you can also fix that problem. There should be an option you can set for your dhcp client not to override the local hostname. The exact option depends on which dhcp client you use I think. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lonepie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 30 Mar 2006 Posts: 9
|
Posted: Thu Mar 30, 2006 6:31 pm Post subject: Woot! |
|
|
Ahh, thank you my friend! Setting the samba hostname was indeed the problem! So simple, I feel foolish that I didn't think of it...
Oh well, thank you very much for your help, problem solved ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|