LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-03-2007, 05:43 AM   #1
melliff
LQ Newbie
 
Registered: Feb 2007
Posts: 2

Rep: Reputation: 0
Broadband router/name resolution


I am using Redhat Linux connected to the BT broadband service via a Vigor Broadband router.
I have configured networking with DHCP and it gets an IP address okay (192.168.1.x) and I can connect to the Internet. I have set the hostname and I get it back when I run the hostname command. However, when I run the host command with the name it says it can't find the name. Nor can it resolve the name of a Windows XP PC on the same network.
I have the following configuration:

/etc/hosts
127.0.0.1 fred localhost.localdomain localhost

/etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 192.168.1.1

/etc/sysconfig/networking
NETWORKING=yes
HOSTNAME=fred
DHCP_HOSTNAME=fred

I assume that the name resolution should be being done by a server at BT but I clearly need something else to get it to do it. I know that I can't put the machines in /etc/hosts because the IP addresses change.

All suggestions welcomed.

Martin.
 
Old 02-03-2007, 09:06 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
If you're using the DHCP server on your broadband gateway to assign IP addresses/gateway IP/DNS IP, it's going to give you a DNS setting that actually relays requests to the ISP's DNS servers. It does not know anything about the hostnames on your internal network.

You have two options:
1.) Use /etc/hosts
2.) Setup your own nameserver and stop using the one provided by DHCP

Option 1 is pretty easy. All you have to do is configure your broadband gateway to always assign the same IP to the same MAC address, which it probably does by default. Only your exteral IP address on the outside of the gateway is going to change. It's highly doubtful that it will change the IP leases for hosts on the internal side of your gateway. Since the IPs will stay the same, configure /etc/hosts with the IP/name mapping. Same for WinXP host (c:\windows\system32\drivers\etc\hosts).

Option 2 is a lot more difficult. First you have to take the time to understand BIND, then install and configure it. Then you need to figure out how to make your DHCP client ignore the DNS server it's given, and instead point it to your own (or disable DHCP entirely).
 
Old 02-03-2007, 09:29 AM   #3
melliff
LQ Newbie
 
Registered: Feb 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Chort,

Thanks for the info. I hadn't realised that the machines on the private network would always get the same address from the router. I have set up the hosts files as you suggest.

Just one point though; if I know the names of the DNS servers at my broadband provider, if I put those in the resolv.conf, would that work? And if so, how would I stop the dhclient-script over-riding them?

Martin.
 
Old 02-03-2007, 10:09 AM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by melliff
Chort,
Just one point though; if I know the names of the DNS servers at my broadband provider, if I put those in the resolv.conf, would that work?
If by "work" you mean "would it resolve my internal hostnames", then the answer is no. If by "work" you mean "would it resolve external hostnames" then the answer is yes. If you mean the latter rather than the former, then I would have to ask "why?" Having your broadband gateway run a DNS cache and forward unresolved lookups to your ISP is probably faster than query your ISPs servers directly.

Quote:
And if so, how would I stop the dhclient-script over-riding them?

Martin.
It depends on how your DHCP client is configured. On Windows you can uncheck the box next to "obtain DNS servers automatically" in your TCP/IP properties. With Linux distributions it depends on what front-end or script is being used to invoke the DHCP client. Check the documentation for your distribution.
Code:
$ apropos dhcp
should point you towards some man pages to read.

Last edited by chort; 02-03-2007 at 10:10 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
broadband router behind a proxy/firewall mariogarcia Linux - Networking 1 02-01-2007 05:02 PM
No sync with Conexant broadband router tkendall Linux - Networking 0 07-24-2005 06:49 AM
Broadband Router glyndwr Linux - Hardware 12 07-14-2004 04:02 PM
IP address of broadband router... lnxkido Linux - Networking 5 12-31-2003 03:47 PM
Broadband router/switch jasonk General 4 12-15-2003 06:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration