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. |
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). |
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. |
Quote:
Quote:
Code:
$ apropos dhcp |
All times are GMT -5. The time now is 12:25 PM. |