1

I have a Ubuntu system with a wired connection to a router, and a USB connection to 4G internet via an iPhone. I want to be able to connect other clients to the router and access the internet via the 4G link. I have followed the steps here iptables forwarding between two interface and it is successfully routing ping requests and seems to connect to sites provided I use the IP address of the site rather than the 'name'. Where I am lost is that once I connect to the router, and use nslookup with the DNS server on the 4G, the correct result is returned, however it can't seem to do that without explicitly giving the server address. I have set this server as the DNS server in the router, and also tried setting it on the client, but neither work. Does anyone have any suggestion what I might be missing?

Alan
  • 13
  • 4
  • why not install bind9 or dnsmasq to do this job on the ubuntu device? – djdomi Jul 28 '21 at 13:25
  • I did consider that, but not sure it will make a difference since nslookup works once I explictly provide the IP of the DNS server. I guess I will give bind a try, see if it helps. – Alan Jul 28 '21 at 15:03
  • Yup, I installed bind on my ubuntu system, and set it to forward all packets to 8.8.8.8. Then set the DNS on the router to use that DNS server, and it works perfectly. Still curious why the existing DNS server didnt work, but sometimes the simple solutions are best! – Alan Jul 29 '21 at 09:39
  • Are you saying that you are using a dedicated router as just a switch (and maybe a DHCP server; WAN disconnected / unused anyway), but this Ubuntu device/PC as the default gateway on other hosts that are connected to this router-as-switch? – Tom Yan Jul 29 '21 at 12:41
  • @TomYan Yes, thats the setup! – Alan Jul 30 '21 at 09:08

1 Answers1

0

As Mentoid by me

Use/install a Local Resolver like Bind9 or dnsmasq

In case you have many requests, it makes more sense to do it on your own.

djdomi
  • 1,377
  • 3
  • 10
  • 19