My android target is connect via Ethernet using static IP. I am able to connect it by using ADB, but I am not able to ping any server. Please tell me how can I configure my DNS setting so that I can ping any server.
How to set DNS when the device is connected via Ethernet?
9.5k Views Asked by shahooo At
2
There are 2 best solutions below
2
izhoujinjian
On
Android 8.0
////////////////////////////////////////////////////////////
ifconfig usb0 192.168.225.3 netmask 255.255.255.0
ndc network create 9792
ndc network interface add 9792 usb0
ndc network route add 9792 usb0 0.0.0.0/0 192.168.225.1
ndc resolver setnetdns 9792 8.8.8.8 8.8.4.4
ndc network default set 9792
///////////////////////////////////////////////////////////
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in NETWORKING
- How to avoid duplicates with the pull-based subscribe model?
- How to simulate CSMA/CD protocol in ns3?
- Network System - Cisco Packet Tracer
- Adhoc / mesh network not working (with and without batman-adv)
- Algorithm for finding a subset of nodes in a weighted connected graph such that the distance between any pair nodes are under a postive number?
- Python Client-Server Communication with Protocol
- I registered a service in eureka which is resolving through java code. But it is not able to resolve its name when hitting through chrome or postman
- Share files from the server without data or internet usage
- Player names not synchronizing in unity Mirror Networking
- My phone can not visit the server on macos in the same local network
- Unable to ping remote websites from an ipV6 only ubuntu ec2 Instance
- Linux Networking - Routing packets from one network interface to another
- wrong output from Supernetting algorithm
- Mapping localhost port on host to docker container
- Microsoft Message Analyzer disable resolving IP address to their domain names a.k.a turn off AutoIP feature
Related Questions in DNS
- AWS Dns record A not navigate to elb
- I created a domain name from cloudflare, and Hoisted my static site hosted in google firebase, error in adding custom domain in firebase
- I am the domain admin, newbie, how do I connect youtube.com on my domain?
- The problem with raising the DNS server on Ubuntu 20.04 - bind9
- I registered a service in eureka which is resolving through java code. But it is not able to resolve its name when hitting through chrome or postman
- Assigned A record for Subdomain in Cloud DNS to Compute Engine VM instance but not propagated/resolved yet
- Why Bind9 responds with latency for RPZ rule?
- Create aws certification for domain
- Make Bind DNS server to request only root DNS servers of IANA website
- Domain Still Redirecting Despite Transferring Out of Godaddy
- Set up MX records in apache/Ubuntu to point to external mail server
- Changing AWS registred domain back to AWS name servers
- Docker networking forwarding failed
- Can access IP address of domain via mobile but not wifi
- CURL got Could not resolve host: my subdomain
Related Questions in RESOLVER
- my json file does not match my graphQL queries
- Implementing Device-Specific Redirects in Angular Routing
- Filtering by sub field in Amplify GraphQL with DynamoDB
- Nginx resolver with proxy pass and variables not functioning
- API for getting list of nameservers used in system
- Propagate errors to parent resolver in GraphQL
- mongoose .findByIdAndUpdate() is not updating the document
- Apollo GraphQL: dynamically caching a schema type, not the entire resolver
- What is the difference between Resolver and Service in java
- Angular 16+ Resolver start before APP_INITIALIZER has end
- AWS Javascript Resolver UpdateItem: The provided key element does not match the schema
- Microservice Communication for Graphql APIs
- Another way of merging graphql resolvers
- Use default resolver/type resolver for non-nullable field in Apollo in TypeScript
- Writing a custom resolver for appsync query
Related Questions in NDC
- My understanding on the projection matrix, perspective division, NDC and viewport transform
- Python RegEx for all National Drug Codes (NDC 10 & 11) formats
- SQL query to reference a large list of values in a where xxcolumnxxx in (list of thousands) (i.e. creating a subset that can persist between queries?)
- OpenGL 4.4 pipeline - perspective division before clipping?
- Why IATA chose XML over JSON for NDC services?
- How to set DNS when the device is connected via Ethernet?
- slf4j-ext NDC PatternLayout
- ndc (nested diagnostic context) in LARAVEL - is it possible?
- Clear DNS cache of Android Device using Command Line
- Transform to NDC, calculate and transform back to worldspace
- Most accurate way to calculate view frustum corners in world space
- How to log request & transaction id in each log line using winston for Node JS?
- Testing ISO8583 & NDC protocols using HP UFT tool
- How to read a tag from PN532 in Python?
- Reconstructing world position from linear depth
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Use this Command by superuser
su
for versions before marshmallow 6.x
ndc resolver setifdns (interface) (dns1) (dns2)
e.g.- ndc resolver setifdns eth0 8.8.8.8 8.8.4.4
for versions from marshmallow 6.x
ndc resolver setnetdns (interface) (dns1) (dns2)
e.g.- ndc resolver setnetdns eth0 8.8.8.8 8.8.4.4