Skip to content
Advertisement

Curl returned ststus 6 (DNS name bad address error)

I am unable to resolve host names when one(3g-cell) of my two interfaces is turned on. One interface is WAN(Ethernet), while the other is 3g-Cell.

When WAN is turned off, I tried to do manual curl request and I was able to do it using 3g-cell interface, but was unable to do that using hostname. (same happened with the ping – used terminal command

ping -I 3g-cell www.google.com

I think this is the issue with dns server or dhcp. Here, WAN seems to resolve DNS names correctly, while cell can’t.

(also I am working on OpenWRT(Linux))

I believe it has to do with some of these config files.

please let me know if you know about the issue.

Thanks.

/etc/config/dhcp:

JavaScript

/etc/resolv.conf:

JavaScript

/etc/config/network:

JavaScript

/etc/config/firewall

Advertisement

Answer

I found the way. The /etc/config/network file was missing the below line inside wan and cell interface.

JavaScript

you need to use different metric_number for different interface. metric_number depends on your priority. Here, I want Ethernet interface to work all the time but if it goes down then network should go on 3g-cell, that is why my metric_number for WAN is low.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement